approvals / approvaltests.net Goto Github PK
View Code? Open in Web Editor NEWApprovalTest verification library for .Net
License: Other
ApprovalTest verification library for .Net
License: Other
Could a note be made on the main markdown readme advising minimum .net version required for version 3 and 2.
Just to accelerate which version to pick when we're on unsupported framework versions.
If you ship pdbs with the nuget package u will get line numbers for bugs
Just got the following exception:
System.Runtime.Serialization.SerializationException : Type 'ApprovalTests.Core.Exceptions.ApprovalMismatchException' in Assembly 'ApprovalTests, Version=3.0.0.0, Culture=neutral, PublicKeyToken=11bd7d124fc62e0f' is not marked as serializable
Like the logging mark, want a disposable handle for AdditionalInfo/ForScenario/UniqueFor*
using(ApprovalResults.UniqueForMachine()){
//test goes here
}
The disposable handle would call NamerFactory.Clear() in order to remove the additional info if the test fails.
Hello,
We have integrated ApprovalTests into our CI environment - unfortunately we are running into a weird issue around build agents.
When ApprovalTests run on the same build agent as they were built, there is no problem. Tests run, everyone is happy.
When ApprovalTests are run on a different build agent, we see the following error:
[_____.ApprovalTests] Test method _____.ApprovalTests.SomeApprovalTest threw exception:
ApprovalTests.Core.Exceptions.ApprovalMissingException: Failed Approval: Approval File "c:\TeamCity\BuildAgent10\work\cf9524f6b7a5308c\_____.ApprovalTests\ApprovalTests\SomeApprovalTest.approved.txt" Not Found.
[10:50:24]
[_____.ApprovalTests.SomeApprovalTest] at ApprovalTests.Approvers.FileApprover.Fail()
at ApprovalTests.Core.Approvals.Verify(IApprovalApprover approver, IApprovalFailureReporter reporter)
at ApprovalTests.Approvals.Verify(IApprovalWriter writer, IApprovalNamer namer, IApprovalFailureReporter reporter)
at ApprovalTests.Approvals.Verify(IApprovalWriter writer)
at ApprovalTests.Approvals.Verify(String text)
at ApprovalTests.Approvals.VerifyAll[T](IEnumerable`1 enumerable, String label)
at _____.ApprovalTests.SomeApprovalTest () in c:\TeamCity\BuildAgent10\work\cf9524f6b7a5308c\_____.ApprovalTests\ApprovalsFixture.cs:line 34
It looks like the test runner is looking for the *.approved.txt files based on their first location?
We have tried to resolve this using DeploymentItems, and by using the [assembly: FrontLoadedReporter(typeof(TeamCityReporter))] annotation - with no success.
I have been able to recreate this issue locally, by running ApprovalTests using MSTest from the cmd line from a different folder than they were built to.
On my buildserver I have not installed Visual Studio. When I use ApprovalTests on this machine I get an exception like this:
.
The type initializer for 'ApprovalTests.Reporters.VisualStudioReporter' threw an exception. ---> System.NullReferenceException: Illegal arguments for VisualStudioReporter (diffProgam, argumentsFormat, diffProgramNotFoundMessage)
Recieved VisualStudioReporter (, /diff "{0}" "{1}", Couldn't find Visual Studio at )
This is because the VisualStudioReporter looks in the registry for key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\devenv.exe
This key does not exists and because of this the string PATH has a value 'null'
As a workaround I have entered a value in the registry and can now run the ApprovalTest
I am using VerifyPdfFile
but the verification is always failing due to
/ModDate (D:20131119191132-06'00')
PdfScrubber scrubs out the created date but not the ModDate
We can make a nuget package that has symbols and source code and send it to symbol source.org then people can debug easily
I have a weird issue that has started happening recently and I can't see to figure out where it may have come from.
All the tests in the solution have started reporting to
c:
rather than to
c:*.approved.txt
This means the files are not getting checked in with subversion.
Is there anything I can do to debug why this might be happening?
I get no intellisense documentation when using ApprovalTests (v2.2).
When I write a WinFormsApprovals.Verify(form);
with a DiffReporter
in a new test I get the following message: "The formats of the of the two files are incompatible and cannot be diffed."
Approving the received file solves the problem.
I expected the diff tool (P4Merge) to launch with the received and an empty image (as the default approved).
Current name is 't'
ISaver.Save(T t)
This is terrible and it makes Code Analysis complain. Can we change it to something else?
Possibilities: item, value, entity
System.IO.FileNotFoundException
Could not load file or assembly 'Microsoft.CompilerServices.AsyncTargetingPack.Net4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
at ApprovalTests.StackTraceParsers.XUnitStackTraceParser.VerifyAsyncUsedProperly(Caller res)
at ApprovalTests.StackTraceParsers.XUnitStackTraceParser.FindApprovalFrame() in c:\Users\James\Documents\GitHub\ApprovalTests.Net\ApprovalTests\Namers\UnitTestFrameworks\XUnitStackTraceParser.cs: line 28
at ApprovalTests.StackTraceParsers.AttributeStackTraceParser.Parse(StackTrace trace) in c:\Users\James\Documents\GitHub\ApprovalTests.Net\ApprovalTests\StackTraceParsers\AttributeStackTraceParser.cs: line 60
at ApprovalTests.StackTraceParsers.StackTraceParser.Parse(StackTrace stackTrace) in c:\Users\James\Documents\GitHub\ApprovalTests.Net\ApprovalTests\StackTraceParsers\StackTraceParser.cs: line 23
at ApprovalTests.Namers.UnitTestFrameworkNamer..ctor() in c:\Users\James\Documents\GitHub\ApprovalTests.Net\ApprovalTests\Namers\UnitTestFrameworkNamer.cs: line 16
at ApprovalTests.Approvals.<.cctor>b__c() in Approvals.cs: line 23
at ApprovalTests.Approvals.GetDefaultNamer() in Approvals.cs: line 133
at ApprovalTests.Approvals.Verify(IApprovalWriter writer) in Approvals.cs: line 96
at ApprovalTests.WinForms.WinFormsApprovals.Verify(Form form) in c:\Users\James\Documents\GitHub\ApprovalTests.Net\ApprovalTests\WinForms\WinFormsApprovals.cs: line 39
at HaarCSharp.Tests.HaarViewerTest.ShowHaarViewer() in HaarViewerTest.cs: line 15
This makes them appear missing when checked out on another machine and kind of defeats the "make TFS notice them" purpose.
Build the ApprovalTests, run this tool:
http://mikehadlow.blogspot.co.uk/2013/10/asmspy-coloured-output.html
Get following messages:
Check assemblies in:
C:\TnT\packages\ApprovalTests.3.0.2\lib\net40
Detailing only conflicting assembly references.
Reference: mscorlib
4.0.0.0 by ApprovalTests
2.0.0.0 by ApprovalTests
Reference: System.Core
4.0.0.0 by ApprovalTests
3.5.0.0 by ApprovalTests
Reference: System.Data.Entity
4.0.0.0 by ApprovalTests
3.5.0.0 by ApprovalTests
Reference: System.Data
4.0.0.0 by ApprovalTests
2.0.0.0 by ApprovalTests
Reference: PresentationFramework
4.0.0.0 by ApprovalTests
3.0.0.0 by ApprovalTests
Could you fix that?
I may be using these methods incorrectly, but I assumed I could point to a file, rather than a string, and have ApprovalTests generate the diff for me. I think I misunderstand how these methods work. Should I be reading the contents of a file as File.ReadAllText
and verifying the contents with ApprovalTests.Verify
?
It would be nice to close the previous reporter when the same test is rerun.
In some cases the reporter can lock the file causing the test to fail the second time around. eg running a reporter on a pdf
Writing xUnit tests in the format
[Fact]
public async Task MyAsyncUnitTest()
{
// ... setup code here ...
var result = await CallMyAsyncApi(...);
// ... assertions here ...
}
as denoted in Brad Wilson's blog
fails with the error
failed: System.Exception : Approvals is not set up to use your test framework.
It currently supports [xUnit.net]
To add one use ApprovalTests.StackTraceParsers.StackTraceParser.AddParser() method to add implementation of ApprovalTests.StackTraceParsers.IStackTraceParser with support for your testing framework.
Have you considered using package restore instead of checking in references?
System.ComponentModel.Win32Exception : A 32 bit processes cannot access modules of a 64 bit process.
ApprovalTests.Reporters.MultiReporter.Report(String approved, String received)
ApprovalTests.Approvers.FileApprover.ReportFailure(IApprovalFailureReporter reporter)
ApprovalTests.Core.Approvals.Verify(IApprovalApprover approver, IApprovalFailureReporter reporter)
ApprovalTests.Approvals.Verify(IApprovalWriter writer, IApprovalNamer namer, IApprovalFailureReporter reporter)
ApprovalTests.Approvals.Verify(IApprovalWriter writer)
ApprovalTests.Xml.XmlApprovals.VerifyText(String text, String fileExtensionWithoutDot, Boolean safely)
ApprovalTests.Html.HtmlApprovals.VerifyHtml(String html)
ApprovalTests.Approvals.VerifyHtml(String html)
want a
using ( var l = Logging.Mark)
{
}
That handles Marker In & Marker out systax.
Should also handle logging parameters passed in.
I had a program named compare.exe in my PATH but it wasn't a text-diff program.
The generic reporter saw the Araxis diff program and prevent my Kdiff3 to launch.
Could you log the reporter used in the error log along the MismatchException message ?
Like this :
Using KDiffReporter (C:\Program Files (x86)\KDiff3\kdiff3.exe)
Under the follow circumstances
I get the following error
System.Exception : Approvals is not set up to use your test framework.
It currently supports [NUnit]
To add one use ApprovalTests.StackTraceParsers.StackTraceParser.AddParser() method to add implementation of ApprovalTests.StackTraceParsers.IStackTraceParser with support for your testing framework.
To learn how to implement one see http://blog.approvaltests.com/2012/01/creating-namers.html
at ApprovalTests.StackTraceParsers.StackTraceParser.Parse(StackTrace stackTrace) in c:\code\ApprovalTests.Net\ApprovalTests\StackTraceParsers\StackTraceParser.cs: line 31
at ApprovalTests.Namers.UnitTestFrameworkNamer..ctor() in c:\code\ApprovalTests.Net\ApprovalTests\Namers\UnitTestFrameworkNamer.cs: line 17
at ApprovalTests.Approvals.<.cctor>b__c() in c:\code\ApprovalTests.Net\ApprovalTests\Approvals.cs: line 24
at ApprovalTests.Approvals.GetDefaultNamer() in c:\code\ApprovalTests.Net\ApprovalTests\Approvals.cs: line 134
at ApprovalTests.Approvals.Verify(IApprovalWriter writer) in c:\code\ApprovalTests.Net\ApprovalTests\Approvals.cs: line 97
at ApprovalTests.Approvals.Verify(String text) in c:\code\ApprovalTests.Net\ApprovalTests\Approvals.cs: line 124
if I add tweak AttributeStackTraceParser.GetFirstFrameForAttribute
to be
public static Caller GetFirstFrameForAttribute(Caller caller, string attributeName)
{
foreach (var caller1 in caller.Callers)
{
Trace.WriteLine(caller1.Method);
}
I get the following below output (note that my test method does not exist in the list)
So it looks like ReSharper is stubbing out the method name when running
Void .ctor()
Void SetCaller()
Void .ctor()
ApprovalTests.Core.IApprovalNamer <.cctor>b__c()
ApprovalTests.Core.IApprovalNamer GetDefaultNamer()
Void Verify(ApprovalTests.Core.IApprovalWriter)
Void Verify(System.String)
System.Object InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)
System.Object UnsafeInvokeInternal(System.Object, System.Object[], System.Object[])
System.Object Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
System.Object InvokeMethod(System.Reflection.MethodInfo, System.Object, System.Object[])
System.Object RunTestMethod()
Void RunTestCase(NUnit.Core.TestResult)
NUnit.Core.TestResult RunTest()
NUnit.Core.TestResult RunTest()
NUnit.Core.TestResult RunRepeatedTest()
NUnit.Core.TestResult RunTestInContext()
NUnit.Core.TestResult Run(NUnit.Core.EventListener, NUnit.Core.ITestFilter)
Void RunAllTests(NUnit.Core.TestResult, NUnit.Core.EventListener, NUnit.Core.ITestFilter)
NUnit.Core.TestResult RunSuite(NUnit.Core.EventListener, NUnit.Core.ITestFilter)
NUnit.Core.TestResult RunSuiteInContext(NUnit.Core.EventListener, NUnit.Core.ITestFilter)
NUnit.Core.TestResult Run(NUnit.Core.EventListener, NUnit.Core.ITestFilter)
Void RunAllTests(NUnit.Core.TestResult, NUnit.Core.EventListener, NUnit.Core.ITestFilter)
NUnit.Core.TestResult RunSuite(NUnit.Core.EventListener, NUnit.Core.ITestFilter)
NUnit.Core.TestResult RunSuiteInContext(NUnit.Core.EventListener, NUnit.Core.ITestFilter)
NUnit.Core.TestResult Run(NUnit.Core.EventListener, NUnit.Core.ITestFilter)
Void RunAllTests(NUnit.Core.TestResult, NUnit.Core.EventListener, NUnit.Core.ITestFilter)
NUnit.Core.TestResult RunSuite(NUnit.Core.EventListener, NUnit.Core.ITestFilter)
NUnit.Core.TestResult RunSuiteInContext(NUnit.Core.EventListener, NUnit.Core.ITestFilter)
NUnit.Core.TestResult Run(NUnit.Core.EventListener, NUnit.Core.ITestFilter)
NUnit.Core.TestResult Run(NUnit.Core.EventListener, NUnit.Core.ITestFilter, Boolean, NUnit.Core.LoggingThreshold)
NUnit.Core.TestResult Run(NUnit.Core.EventListener, NUnit.Core.ITestFilter)
Void RunTests(JetBrains.ReSharper.TaskRunnerFramework.IRemoteTaskServer, System.Collections.Generic.Dictionary`2[System.String,JetBrains.ReSharper.TaskRunnerFramework.RemoteTask], System.Collections.Generic.Dictionary`2[System.String,JetBrains.ReSharper.TaskRunnerFramework.RemoteTask], System.Collections.Generic.List`1[System.String], Boolean, System.Collections.Generic.List`1[System.String])
System.Object _PrivateProcessMessage(IntPtr, System.Object[], System.Object, System.Object[] ByRef)
System.Runtime.Remoting.Messaging.IMessage SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage)
System.Runtime.Remoting.Messaging.IMessage SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage)
System.Runtime.Remoting.Messaging.IMessage SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage)
System.Object SyncProcessMessageCallback(System.Object[])
System.Object InternalCrossContextCallback(System.Runtime.Remoting.Contexts.Context, IntPtr, Int32, System.Threading.InternalCrossContextDelegate, System.Object[])
System.Runtime.Remoting.Messaging.IMessage SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage)
System.Runtime.Remoting.Messaging.IMessage SyncDispatchMessage(System.Runtime.Remoting.Messaging.IMessage)
Byte[] DoDispatch(Byte[], System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage, System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage ByRef)
System.Object DoTransitionDispatchCallback(System.Object[])
this http://approvaltests.com/ redirects to this http://approvaltests.sourceforge.net/
when it should be the other way around
Throws an exception: only works in VS11
Approvals throws execption instead of providing feedback, when VerifyAll receives a null dictionary.
Should check null and say "Empty" or something like that.
System.ArgumentNullException
Value cannot be null.
Parameter name: source
at System.Linq.OrderedEnumerable2..ctor(IEnumerable
1 source, Func2 keySelector, IComparer
1 comparer, Boolean descending)
at System.Linq.Enumerable.OrderBy(IEnumerable1 source, Func
2 keySelector)
at ApprovalTests.Approvals.VerifyAll(IDictionary`2 dictionary) in c:\code\ApprovalTests.Net\ApprovalTests\Approvals.cs: line 186
at....
I want to help knock some of these issues out but I've been unable to figure out the requirejs test harness. There's no build system file and nothing on the "contributing" page about it. I've started a simple web server and pointed to the test page but get 242 tests in 129 groups /21 errors, 0 failures
.
Is that correct? Is there some other way to do this?
[Test]
public async void AsyncTest()
{
await Task.Delay(10);
Approvals.Verify("Foo");
}
result in
System.Exception : Approvals is not set up to use your test framework.
It currently supports [NUnit, MsTest, MbUnit, xUnit.net, xUnit.extensions, Machine.Specifications (MSpec)]
To add one use ApprovalTests.StackTraceParsers.StackTraceParser.AddParser() method to add implementation of ApprovalTests.StackTraceParsers.IStackTraceParser with support for your testing framework.
To learn how to implement one see http://blog.approvaltests.com/2012/01/creating-namers.html
at ApprovalTests.StackTraceParsers.StackTraceParser.Parse(StackTrace stackTrace) in c:\code\ApprovalTests.Net\ApprovalTests\StackTraceParsers\StackTraceParser.cs: line 31
at ApprovalTests.Namers.UnitTestFrameworkNamer..ctor() in c:\code\ApprovalTests.Net\ApprovalTests\Namers\UnitTestFrameworkNamer.cs: line 17
at ApprovalTests.Approvals.<.cctor>b__c() in c:\code\ApprovalTests.Net\ApprovalTests\Approvals.cs: line 24
at ApprovalTests.Approvals.GetDefaultNamer() in c:\code\ApprovalTests.Net\ApprovalTests\Approvals.cs: line 134
at ApprovalTests.Approvals.Verify(IApprovalWriter writer) in c:\code\ApprovalTests.Net\ApprovalTests\Approvals.cs: line 97
at ApprovalTests.Approvals.Verify(String text) in c:\code\ApprovalTests.Net\ApprovalTests\Approvals.cs: line 124
at MyTests.<AsyncTests>d__4.MoveNext() in PowerShellRunnerTests.cs: line 28
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__0(Object state)
at NUnit.Framework.AsyncSynchronizationContext.AsyncOperationQueue.InvokePendingOperations()
at NUnit.Framework.AsyncSynchronizationContext.AsyncOperationQueue.InvokeAll()
at NUnit.Framework.AsyncInvocationRegion.AsyncVoidInvocationRegion.WaitForPendingOperationsToComplete(Object invocationResult)
at NUnit.Framework.AsyncInvocationRegion.AsyncVoidInvocationRegion.WaitForPendingOperationsToComplete(Object invocationResult)
at NUnit.Core.NUnitAsyncTestMethod.RunTestMethod()
What I wanted was an easy way to take two strings and if they differed compare them with a diff tool.
Per our pairing session. Below is a helper we hashed out to quickly diff two strings.
I moved it into an extension method. Not sure I'm happy with the naming - but it'll do for now.
var a = "Hello World";
var b = "Hello Wlrod";
a.DiffWith(b);
public static class ApprovalsExtensions
{
public static void DiffWith(this string expected, string actual)
{
if (expected != actual)
{
var expectedFile = System.IO.Path.GetTempPath() + "Expected.Approvals.Temp.txt";
var actualFile = System.IO.Path.GetTempPath() + "Actual.Approvals.Temp.txt";
System.IO.File.WriteAllText(expectedFile, expected);
System.IO.File.WriteAllText(actualFile, actual);
var reporter = ApprovalTests.Approvals.GetReporter();
reporter.Report(expectedFile, actualFile);
}
}
}
When i google "approval tests" i get this
http://approvaltests.sourceforge.net/
which doesnt have a link to this
Get an exception when trying to test a report that has external images.
The exception is: "Report 'XXX' contains external images. The EnableExternalImages property has not been set for this report.
This is using the RdlcApprovals.VerifyReport() method.
As demonstrated by this skipped unit test
When you have a truly awaitable situation (not simply Task.FromResult(...)
where the await gets compiled away) the compiled code has no method in the stacktrace with a FactAttribute
and ApprovalTests falsely accuses you of using an unsupported framework since no namer can figure out what to name things.
pushing doco through a blog (http://blog.approvaltests.com/) has several issue
So I have a dodgy path in my environment
C:\Users\Simon\AppData\Local\Pandoc"
Note the extra trailing "
So my bad but ApprovalTests gave me a distinctly unhelpful error :)
System.ArgumentException : Illegal characters in path.
at System.IO.Path.Combine(String path1, String path2)
at ApprovalUtilities.Utilities.PathUtilities.<>c__DisplayClass1.<LocateFileFromEnviormentPath>b__0(String path) in PathUtilities.cs: line 46
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
at ApprovalUtilities.Utilities.PathUtilities.LocateFileFromEnviormentPath(String toFind) in PathUtilities.cs: line 47
at ApprovalTests.Reporters.GenericDiffReporter.GetActualProgramFile(String fullPath) in c:\Code\ApprovalTests.Net\ApprovalTests\Reporters\GenericDiffReporter.cs: line 114
at ApprovalTests.Reporters.GenericDiffReporter.GetDiffProgram() in c:\Code\ApprovalTests.Net\ApprovalTests\Reporters\GenericDiffReporter.cs: line 122
at ApprovalTests.Reporters.GenericDiffReporter.IsWorkingInThisEnvironment(String forFile) in c:\Code\ApprovalTests.Net\ApprovalTests\Reporters\GenericDiffReporter.cs: line 140
at ApprovalTests.Reporters.FirstWorkingReporter.<>c__DisplayClass1.<Report>b__0(IEnvironmentAwareReporter x) in c:\Code\ApprovalTests.Net\ApprovalTests\Reporters\FirstWorkingReporter.cs: line 24
at System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source, Func`2 predicate)
at ApprovalTests.Reporters.FirstWorkingReporter.Report(String approved, String received) in c:\Code\ApprovalTests.Net\ApprovalTests\Reporters\FirstWorkingReporter.cs: line 24
at ApprovalTests.Approvers.FileApprover.ReportFailure(IApprovalFailureReporter reporter) in c:\Code\ApprovalTests.Net\ApprovalTests\Approvers\FileApprover.cs: line 55
at ApprovalTests.Core.Approvals.Verify(IApprovalApprover approver, IApprovalFailureReporter reporter) in c:\Code\ApprovalTests.Net\ApprovalTests\Core\Approvals.cs: line 12
at ApprovalTests.Approvals.Verify(IApprovalWriter writer, IApprovalNamer namer, IApprovalFailureReporter reporter) in c:\Code\ApprovalTests.Net\ApprovalTests\Approvals.cs: line 45
at ApprovalTests.Approvals.Verify(IApprovalWriter writer) in c:\Code\ApprovalTests.Net\ApprovalTests\Approvals.cs: line 97
at ApprovalTests.Approvals.Verify(String text) in c:\Code\ApprovalTests.Net\ApprovalTests\Approvals.cs: line 124
at InformationalVersionBuilderTests.Json() in InformationalVersionBuilderTests.cs: line 48
Not everyone needs it and it creates an annoying interruption to workflow when Visual Studio asks if it is OK to reload the project because it has been "Modified outside the environment."
ATM the nuget package has the dll placed in the "Lib" dir
This tells nuget that approval tests is comparable with any runtime which is not the case
Better to place the dll in lib\net40
so it is explicit
I get this error when i try to build the latest
Error 130 This version of C:\Code\ApprovalTests.Net\.nuget\NuGet.exe is not
compatible with the version of Windows you're running. Check your computer's system
information to see whether you need a x86 (32-bit) or x64 (64-bit) version of the program,
and then contact the software publisher. C:\Code\ApprovalTests.Net\.nuget\nuget.targets
90 9 ApprovalTests.MSpec
I have a project i recently adopted, fork is here: https://github.com/jamesrcounts/usaddress
It came with NUnit tests. I installed the prerelease ApprovalTests package and added a verify to 1 of the tests, and it the resharper runner spun for minutes without returning.
I ran the test with the VS runner, and the test ran to completion as expected.
I downgraded to the release version of AppprovalTests and the test ran to completion in the resharper runner as expected.
It would be great if we could tell approval tests to write out using a specific line ending type.
I have odd scenarios where r# will pass, but nCrunch will fail (due to line endings I think).
At VNext OC we collected a bunch of exceptions and verified them with VerifyAll but the stack trace scrubber was not applied, so the line numbers showed up in the result file, so the test was fragile.
The path to Visual Studio is hardcoded in the VisualStudioReporter so that it only works with VS2012.
One approach to getting the path could be from the registry. Something like:
this
I couldn't find the registry key any "official" place, but it is mention both on Microsofts social site and stackoverflow
So here
https://github.com/approvals/ApprovalTests.Net/blob/master/MvcApplication.Razor/packages.config#L6
you reference jQuery.Validation 1.8.0
which does not exist https://nuget.org/packages/jQuery.Validation/
So this will stop people from doing a build with package restore.
Need to either be removed or changed to a package that exists
It appears that when I use TortoiseMerge to accept a received txt file that ends in a linebreak, that linebreak is not actually saved to the file, so the line shows up as a difference on each run which causes the test to constantly fail, even though the left and right side of my merge view show the only difference is that final trailing line break.
Though using BeyondCompare to copy received to approved seems to respect whitespace more exactly and allows the test to pass.
Perhaps the verifyall could ignore a final, trailing whitespace? or treat it as a warning instead of a fail? or expose an option to do so?
Would be nice to set up this project on a build server somewhere.
Let me know if you need any help
We were running an XUnit theory. We added additional data to approval tests. We made a change to the implementation that broke the theory and the tests failed. When the theory failed the "AdditionalInfo" we provided the namer factory would be applied to other tests, which weren't theories and where we were not providing any additional info.
It should be called ApprovalBinaryWriter to be consistent with ApprovalTextWriter, also this avoids ambiguity with System.IO.BinaryWriter.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.