我试图使用批准测试,但甚至不能运行“hello world”。当我进行测试时
Test Name: TestHelloWorld
Test FullName: HelloApprovalTests.Class1.TestHelloWorld
Test Source: C:\Users\Lassi\Documents\Visual Studio 2015\Projects\HelloApprovalTests\HelloApprovalTests\Class1.cs : line 14
Test Outcome: Failed
Test Duration: 0:00:00.01
Result StackTrace:
at ApprovalTests.Namers.UnitTestFrameworkNamer..ctor()
at ApprovalTests.Approvals.<.cctor>b__c()
at ApprovalTests.Approvals.GetDefaultNamer()
at ApprovalTests.Approvals.Verify(IApprovalWriter writer)
at ApprovalTests.Approvals.Verify(String text)
at HelloApprovalTests.Class1.TestHelloWorld() in C:\Users\Lassi\Documents\Visual Studio 2015\Projects\HelloApprovalTests\HelloApprovalTests\Class1.cs:line 15
Result Message: System.MissingMethodException : Method not found: 'System.Diagnostics.StackTrace ApprovalUtilities.CallStack.Caller.get_StackTrace()'.
我的班级是:
using ApprovalTests;
using ApprovalTests.Reporters;
using NUnit.Framework;
namespace HelloApprovalTests
{
[TestFixture]
[UseReporter(typeof(DiffReporter))]
public class Class1
{
[Test]
public void TestHelloWorld()
{
Approvals.Verify("Hello World Welcome to ApprovalTests");
}
}
}
我该怎么做才能运行并创建一个文件?
最佳答案
在nuget安装上有点奇怪。如果您更新了approvalutilities,它将起作用。