Code Monkey home page Code Monkey logo

approvaltests.net's People

Contributors

304notmodified avatar actions-user avatar asherber avatar claremacrae avatar dalpert-korewireless avatar danielmarbach avatar dependabot-preview[bot] avatar dependabot[bot] avatar dionfoster avatar distantcam avatar geertvanhorrik avatar isidore avatar jakeginnivan avatar jamesrcounts avatar jawn avatar jaybazuzi avatar jim-cooper avatar julian-maughan avatar manuc66 avatar markskiba avatar michaelferrante avatar ondjuric avatar rasher666 avatar simoncropp avatar skalinets avatar staxmanade avatar steenhulthin avatar stocksr avatar valdisthomann avatar viktorhofer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

approvaltests.net's Issues

Exceptions should be serializable

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

Enhance Namer.AdditionalInfo

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.

Weird ApprovalTests issue when running in TeamCity

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.

VisualStudioReporter throws an exception on my Buildserver where VS is not installed

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

PdfScrubber doesn't scrub modified date

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

All tests are running in C:/ root.

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?

image diff between image file and text file gives a unfriendly mesage with P4Merge

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."

p4merge_error_message

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).

p4merge_expected

Fix parameter name of ISaver.Save

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

Xunit tests broken

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

Reference different versions of the same assembly

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?

VerifyFile and Verify(FileInfo) don't seem to work

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?

Close previous reported when test is re-run

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

Cannot run with xUnit async tests

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.

"A 32 bit processes cannot access modules of a 64 bit process." on TFS

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)

add Logging.Mark

want a

using ( var l = Logging.Mark)
{
}

That handles Marker In & Marker out systax.
Should also handle logging parameters passed in.

log name and path of the Reporter in test output

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)

Poor Error message when TestMethods are inlined -- [original]Failing to discover test framework in R#8.1 EAP

Under the follow circumstances

  • VS2012
  • Resharper EAP 8.1.11.55
  • Release mode
  • No Debugger attached

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[])

VerifyAll can't handle null

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(IEnumerable1 source, Func2 keySelector, IComparer1 comparer, Boolean descending)
at System.Linq.Enumerable.OrderBy(IEnumerable1 source, Func2 keySelector)
at ApprovalTests.Approvals.VerifyAll(IDictionary`2 dictionary) in c:\code\ApprovalTests.Net\ApprovalTests\Approvals.cs: line 186
at....

How do you run the RequireJs test harness?

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?

async tests fail to find testing framework

[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()

Easily diff two strings.

The Need

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.

Usage

var a = "Hello World";
var b = "Hello Wlrod";
a.DiffWith(b);

Extension Method

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);
        }
    }
}

Rdlc report with external images

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.

Get true async tests working for xUnit (possibly others)

As demonstrated by this skipped unit test

07c55b3

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.

move blog posts to Doco

pushing doco through a blog (http://blog.approvaltests.com/) has several issue

  • Blogs are dated: blogs are meant to be a series of articles, each at a point in time. By that nature they become out of date. So when a person looks at a given blog post it is difficult to tell if it is up-to-date
  • Difficult to take contributions: blogs dont map well to taking contributions from the community.
  • versioning: few blogs support versioning well. so it is difficult for the public to see how things have evolved
  • multi-user permissions: if you have several owners of a project it can be difficult to manage those permissions on a blog

invalid path in PATH variable gives unhelpful error

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

capture

Make "add approve file to project" optional

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."

nuget is corrupted

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

PreRelease - NUnit never finishes

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.

Guidance/support around line endings

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).

Verify Collections of exceptions

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.

Approvals.VerifyAll fails when last character is a line break

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?

Add a CI Build

Would be nice to set up this project on a build server somewhere.
Let me know if you need any help

AdditionalInfo not cleared when test fails

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.

Rename BinaryWriter

It should be called ApprovalBinaryWriter to be consistent with ApprovalTextWriter, also this avoids ambiguity with System.IO.BinaryWriter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.