我是全新的Windows商店应用程序编程, 因此我也是Visual Studio Express的新手。如何制作.dll并使用NUnit运行它?
我的目标是测试一个simpple类的方法。 如上述here Express版本没有任何内置单元测试。 在这thread,拉法尔提供solution。
我正好也喜欢它说明,所以我的外部工具是这样的:
当我执行它(工具 - >“执行NUnit的”),NUnit的开始和NUnit的桂出现。但突然出现这种异常:
而且在异常详细信息:
System.IO.FileNotFoundException...
at NUnit.Util.ProjectService.WrapAssembly(String assemblyPath)
at NUnit.Util.ProjectService.ConvertFrom(String path)
at NUnit.Util.ProjectService.LoadProject(String path)
at NUnit.Util.TestLoader.LoadProject(String filePath, String configName)
我的项目文件夹中有这样的结构:
的测试类是“WebTest的。共享”。
我想我需要一个.dll在NUnit中运行,如Jon here所述。 那么,我如何才能使我的项目中的一个DLL与NUnit一起运行? 任何人都可以指导我解决这个问题吗? (请一步一步)
编辑:
后,我在圣油的想法工作,异常stll没有出现 “$ {BINDIR} $ {}的TargetName .dll文件/运行” 挡(异常的详细信息是相同的前):
EDIT 2:
个我已经设置这些值:
标题:执行NUnit的
命令: d:\路径\为\ NUnit的\ BIN \ nunit.exe
参数: $(BINDIR )$(TARGETDIR)$(TargetExt)/运行
初始目录: $(BINDIR)
编辑号3:
关闭并重新打开VS快递 后我得到这个新的异常:
而且在NUnit的异常详细信息:
System.ApplicationException:无法组装找到测试
System.ApplicationException ...
编辑编号4
这里是我的测试类(StringUtilitiesTest.cs):
using System;
using System.Collections.Generic;
using System.Text;
using WebappTest.Shared.Utilities;
using NUnit.Framework;
namespace WebappTest.UnitTest
{
[TestFixture]
public class StringUtilitiesTest
{
[Test]
public void TransferFunds()
{
Assert.AreEqual("Hello", StringUtilites.getString("Hello"));
}
}
}
对我没有提示? – 2014-10-02 08:23:48