From 6fe626668f9d934cfda05f75919283f35aae7ea8 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 11 May 2024 17:00:42 +1000 Subject: [PATCH 01/12] . --- docs/ApprovalTests/Features.md | 25 +- docs/ApprovalTests/ReportersGettingStarted.md | 7 +- .../explanations/MainConcepts.md | 9 +- .../CustomizingDiffToolSelectionOrder.md | 28 +- readme.md | 29 +- .../ApprovalTests.NUnit3.csproj | 26 + .../ApprovalTestsConfig.cs | 4 + .../ApprovalsTest.Dictionary.approved.txt | 11 + ...pprovalsTest.DictionaryCustom.approved.txt | 11 + ...Test.DictionaryCustomNoHeader.approved.txt | 9 + ...pprovalsTest.DictionarySimple.approved.txt | 9 + ...sTest.EnumerableWithFormatter.approved.txt | 3 + ...merableWithHeaderAndFormatter.approved.txt | 11 + ...ovalsTest.EnumerableWithLabel.approved.txt | 3 + ...umerableWithLabelAndFormatter.approved.txt | 3 + .../ApprovalsTest.JsonText.approved.json | 15 + .../ApprovalsTest.TestBytes.approved.png | Bin 0 -> 417 bytes ...pprovalsTest.TestExistingFile.approved.txt | 1 + .../ApprovalsTest.Text.approved.txt | 1 + .../ApprovalsTest.VerifyAllNull.approved.txt | 1 + ...provalsTest.VerifyAllWithNull.approved.txt | 4 + ...valsTest.VerifyNullDictionary.approved.txt | 1 + ...ovalsTest.VerifyWithExtension.approved.csv | 1 + src/ApprovalTests.NUnit3/ApprovalsTest.cs | 108 ++++ .../Async/AsyncTests.TestAsync.approved.txt | 1 + src/ApprovalTests.NUnit3/Async/AsyncTests.cs | 17 + src/ApprovalTests.NUnit3/CleanupReporter.cs | 7 + .../CombinationApprovalsTests.cs | 12 + ...ntApprovalsTest.MulticastPoco.approved.txt | 6 + ...ventApprovalsTest.UnicastPoco.approved.txt | 8 + .../Events/EventApprovalsTest.cs | 21 + .../Events/TestingEventPoco.cs | 20 + .../Events/TestingListener.cs | 12 + ...xceptionTests.VerifyException.approved.txt | 1 + ...icrosoft_Windows_10_Education.approved.txt | 3 + ...crosoft_Windows_10_Enterprise.approved.txt | 3 + ...e.Microsoft_Windows_10_Home_N.approved.txt | 3 + ...race.Microsoft_Windows_10_Pro.approved.txt | 3 + ...crosoft_Windows_11_Enterprise.approved.txt | 3 + ...race.Microsoft_Windows_11_Pro.approved.txt | 3 + ...indows_Server_2016_Datacenter.approved.txt | 3 + ...indows_Server_2019_Datacenter.approved.txt | 3 + src/ApprovalTests.NUnit3/ExceptionTests.cs | 28 + ...t.TestExecutableFailure.Inner.approved.txt | 1 + ...bleTest.TestExecutableFailure.approved.txt | 1 + ...ureWithPreviousApproval.Inner.approved.txt | 1 + ...leFailureWithPreviousApproval.approved.txt | 2 + ...t.TestExecutableSuccess.Inner.approved.txt | 1 + ...bleTest.TestExecutableSuccess.approved.txt | 1 + .../Executable/ExecutableTest.cs | 47 ++ ...numerableDoesNotMatchApproval.approved.txt | 1 + ...ests.TextDoesNotMatchApproval.approved.txt | 1 + .../FailedApprovalTests.cs | 32 ++ src/ApprovalTests.NUnit3/FileApproverTests.cs | 46 ++ src/ApprovalTests.NUnit3/GlobalUsings.cs | 26 + ...tomNamerShouldBeSubstitutable.approved.txt | 1 + .../CustomNamerShouldBeSubstitutableTest.cs | 43 ++ ...kDownTests.TestExceptions.Mac.approved.txt | 4 + ...icrosoft_Windows_10_Education.approved.txt | 4 + ...crosoft_Windows_10_Enterprise.approved.txt | 4 + ...s.Microsoft_Windows_10_Home_N.approved.txt | 4 + ...ions.Microsoft_Windows_10_Pro.approved.txt | 4 + ...crosoft_Windows_11_Enterprise.approved.txt | 4 + ...ions.Microsoft_Windows_11_Pro.approved.txt | 4 + ...indows_Server_2016_Datacenter.approved.txt | 4 + ...indows_Server_2019_Datacenter.approved.txt | 4 + ...ests.TestExceptions.Windows_7.approved.txt | 4 + ...ests.TestExceptions.Windows_8.approved.txt | 4 + .../LockDownTests.TestLockDown.approved.txt | 512 ++++++++++++++++++ .../LockDownTests.TestLockDown2.approved.txt | 4 + .../LockDownTests.TestLockDown8.approved.txt | 256 +++++++++ src/ApprovalTests.NUnit3/LockDownTests.cs | 39 ++ ...st.FindAbandonedApprovalFiles.approved.txt | 3 + ...tenanceTest.Nested.MethodName.approved.txt | 1 + .../Maintenance/ApprovalMaintenanceTest.cs | 21 + src/ApprovalTests.NUnit3/ModuleInitializer.cs | 6 + .../Reporters/AssemblyLevelTest.cs | 12 + .../Reporters/CustomDiffReporter.cs | 22 + ...ingReporterTest.TestException.approved.txt | 1 + .../Reporters/FirstWorkingReporterTest.cs | 72 +++ ...extReporterTest.CSharpStrings.approved.txt | 9 + .../Reporters/InlineTextReporterTest.cs | 64 +++ ...ctionReporterTest.TestComment.approved.txt | 31 ++ .../Reporters/IntroductionReporterTest.cs | 7 + .../Reporters/MultiReporterTest.cs | 27 + ...UnitReporterTest.TestReporter.approved.txt | 1 + .../Reporters/NUnitReporterTest.cs | 33 ++ .../Reporters/NUnitReporterWithCleanup.cs | 16 + ...boardReporterTest.TestCommand.approved.txt | 1 + .../PowerShellClipboardReporterTest.cs | 7 + .../Reporters/RecordingReporter.cs | 18 + .../Reporters/ReporterFactoryTest.cs | 89 +++ ...estInvalidReporterShouldThrow.approved.txt | 9 + ...ithInvalidReporterShouldThrow.approved.txt | 9 + .../Reporters/ReporterTest.cs | 41 ++ ...oiseImageDiffTest.TestIsImage.approved.txt | 9 + .../Reporters/TortoiseImageDiffTest.cs | 21 + src/ApprovalTests.NUnit3/RunMaintenance.cs | 14 + .../SampleTest.TestList.approved.txt | 5 + src/ApprovalTests.NUnit3/SampleTest.cs | 15 + .../Set/SetTests.TestFile.approved.txt | 3 + ...SetTests.TestFileWithScrubber.approved.txt | 3 + .../Set/SetTests.TestListObject.approved.txt | 3 + .../Set/SetTests.TestListString.approved.txt | 3 + src/ApprovalTests.NUnit3/Set/SetTests.cs | 53 ++ src/ApprovalTests.NUnit3/Set/a.txt | 3 + .../StackTraceScrubberTest.cs | 24 + .../StringEncodingTest.TestAscii.approved.txt | 1 + ...tringEncodingTest.TestUnicode.approved.txt | 1 + .../StringEncodingTest.TestUtf8.approved.txt | 1 + .../StringEncodingTest.cs | 27 + src/ApprovalTests.NUnit3/UnixLineEndings.txt | 2 + .../WindowsLineEndings.txt | 2 + ...eTest.TestExistFileIsApproved.approved.png | Bin 0 -> 417 bytes .../Writers/ExistingFileTest.cs | 17 + .../Writers/WriterFactoryTests.cs | 34 ++ ....TestOrderedXmlWithAttributes.approved.xml | 4 + ...tOrderedXmlWithDeepAttributes.approved.xml | 4 + .../Xml/XmlTest.TestXml.approved.xml | 4 + src/ApprovalTests.NUnit3/Xml/XmlTest.cs | 17 + src/ApprovalTests.NUnit3/a.png | Bin 0 -> 417 bytes src/ApprovalTests.NUnit3/a.txt | 1 + src/ApprovalTests.NUnit3/b.png | Bin 0 -> 3257 bytes src/ApprovalTests.NUnit3/b.txt | 1 + src/ApprovalTests.sln | 6 + 125 files changed, 2307 insertions(+), 7 deletions(-) create mode 100644 src/ApprovalTests.NUnit3/ApprovalTests.NUnit3.csproj create mode 100644 src/ApprovalTests.NUnit3/ApprovalTestsConfig.cs create mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.Dictionary.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.DictionaryCustom.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.DictionaryCustomNoHeader.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.DictionarySimple.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithFormatter.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithHeaderAndFormatter.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithLabel.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithLabelAndFormatter.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.JsonText.approved.json create mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.TestBytes.approved.png create mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.TestExistingFile.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.Text.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.VerifyAllNull.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.VerifyAllWithNull.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.VerifyNullDictionary.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.VerifyWithExtension.approved.csv create mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.cs create mode 100644 src/ApprovalTests.NUnit3/Async/AsyncTests.TestAsync.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Async/AsyncTests.cs create mode 100644 src/ApprovalTests.NUnit3/CleanupReporter.cs create mode 100644 src/ApprovalTests.NUnit3/CombinationApprovalsTests.cs create mode 100644 src/ApprovalTests.NUnit3/Events/EventApprovalsTest.MulticastPoco.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Events/EventApprovalsTest.UnicastPoco.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Events/EventApprovalsTest.cs create mode 100644 src/ApprovalTests.NUnit3/Events/TestingEventPoco.cs create mode 100644 src/ApprovalTests.NUnit3/Events/TestingListener.cs create mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.VerifyException.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Education.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Enterprise.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Home_N.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Pro.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_11_Enterprise.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_11_Pro.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_Server_2016_Datacenter.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_Server_2019_Datacenter.approved.txt create mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.cs create mode 100644 src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailure.Inner.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailure.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailureWithPreviousApproval.Inner.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailureWithPreviousApproval.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableSuccess.Inner.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableSuccess.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Executable/ExecutableTest.cs create mode 100644 src/ApprovalTests.NUnit3/FailedApprovalTests.EnumerableDoesNotMatchApproval.approved.txt create mode 100644 src/ApprovalTests.NUnit3/FailedApprovalTests.TextDoesNotMatchApproval.approved.txt create mode 100644 src/ApprovalTests.NUnit3/FailedApprovalTests.cs create mode 100644 src/ApprovalTests.NUnit3/FileApproverTests.cs create mode 100644 src/ApprovalTests.NUnit3/GlobalUsings.cs create mode 100644 src/ApprovalTests.NUnit3/Issues/CustomNamerShouldBeSubstitutableTest.CustomNamerShouldBeSubstitutable.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Issues/CustomNamerShouldBeSubstitutableTest.cs create mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Mac.approved.txt create mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Education.approved.txt create mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Enterprise.approved.txt create mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Home_N.approved.txt create mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Pro.approved.txt create mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_11_Enterprise.approved.txt create mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_11_Pro.approved.txt create mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_Server_2016_Datacenter.approved.txt create mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_Server_2019_Datacenter.approved.txt create mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Windows_7.approved.txt create mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Windows_8.approved.txt create mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestLockDown.approved.txt create mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestLockDown2.approved.txt create mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestLockDown8.approved.txt create mode 100644 src/ApprovalTests.NUnit3/LockDownTests.cs create mode 100644 src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.FindAbandonedApprovalFiles.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.Nested.MethodName.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.cs create mode 100644 src/ApprovalTests.NUnit3/ModuleInitializer.cs create mode 100644 src/ApprovalTests.NUnit3/Reporters/AssemblyLevelTest.cs create mode 100644 src/ApprovalTests.NUnit3/Reporters/CustomDiffReporter.cs create mode 100644 src/ApprovalTests.NUnit3/Reporters/FirstWorkingReporterTest.TestException.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Reporters/FirstWorkingReporterTest.cs create mode 100644 src/ApprovalTests.NUnit3/Reporters/InlineTextReporterTest.CSharpStrings.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Reporters/InlineTextReporterTest.cs create mode 100644 src/ApprovalTests.NUnit3/Reporters/IntroductionReporterTest.TestComment.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Reporters/IntroductionReporterTest.cs create mode 100644 src/ApprovalTests.NUnit3/Reporters/MultiReporterTest.cs create mode 100644 src/ApprovalTests.NUnit3/Reporters/NUnitReporterTest.TestReporter.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Reporters/NUnitReporterTest.cs create mode 100644 src/ApprovalTests.NUnit3/Reporters/NUnitReporterWithCleanup.cs create mode 100644 src/ApprovalTests.NUnit3/Reporters/PowerShellClipboardReporterTest.TestCommand.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Reporters/PowerShellClipboardReporterTest.cs create mode 100644 src/ApprovalTests.NUnit3/Reporters/RecordingReporter.cs create mode 100644 src/ApprovalTests.NUnit3/Reporters/ReporterFactoryTest.cs create mode 100644 src/ApprovalTests.NUnit3/Reporters/ReporterTest.TestInvalidReporterShouldThrow.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Reporters/ReporterTest.TestMultipleWithInvalidReporterShouldThrow.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Reporters/ReporterTest.cs create mode 100644 src/ApprovalTests.NUnit3/Reporters/TortoiseImageDiffTest.TestIsImage.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Reporters/TortoiseImageDiffTest.cs create mode 100644 src/ApprovalTests.NUnit3/RunMaintenance.cs create mode 100644 src/ApprovalTests.NUnit3/SampleTest.TestList.approved.txt create mode 100644 src/ApprovalTests.NUnit3/SampleTest.cs create mode 100644 src/ApprovalTests.NUnit3/Set/SetTests.TestFile.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Set/SetTests.TestFileWithScrubber.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Set/SetTests.TestListObject.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Set/SetTests.TestListString.approved.txt create mode 100644 src/ApprovalTests.NUnit3/Set/SetTests.cs create mode 100644 src/ApprovalTests.NUnit3/Set/a.txt create mode 100644 src/ApprovalTests.NUnit3/StackTraceScrubberTest.cs create mode 100644 src/ApprovalTests.NUnit3/StringEncodingTest.TestAscii.approved.txt create mode 100644 src/ApprovalTests.NUnit3/StringEncodingTest.TestUnicode.approved.txt create mode 100644 src/ApprovalTests.NUnit3/StringEncodingTest.TestUtf8.approved.txt create mode 100644 src/ApprovalTests.NUnit3/StringEncodingTest.cs create mode 100644 src/ApprovalTests.NUnit3/UnixLineEndings.txt create mode 100644 src/ApprovalTests.NUnit3/WindowsLineEndings.txt create mode 100644 src/ApprovalTests.NUnit3/Writers/ExistingFileTest.TestExistFileIsApproved.approved.png create mode 100644 src/ApprovalTests.NUnit3/Writers/ExistingFileTest.cs create mode 100644 src/ApprovalTests.NUnit3/Writers/WriterFactoryTests.cs create mode 100644 src/ApprovalTests.NUnit3/Xml/XmlTest.TestOrderedXmlWithAttributes.approved.xml create mode 100644 src/ApprovalTests.NUnit3/Xml/XmlTest.TestOrderedXmlWithDeepAttributes.approved.xml create mode 100644 src/ApprovalTests.NUnit3/Xml/XmlTest.TestXml.approved.xml create mode 100644 src/ApprovalTests.NUnit3/Xml/XmlTest.cs create mode 100644 src/ApprovalTests.NUnit3/a.png create mode 100644 src/ApprovalTests.NUnit3/a.txt create mode 100644 src/ApprovalTests.NUnit3/b.png create mode 100644 src/ApprovalTests.NUnit3/b.txt diff --git a/docs/ApprovalTests/Features.md b/docs/ApprovalTests/Features.md index 0411f508..332a346c 100644 --- a/docs/ApprovalTests/Features.md +++ b/docs/ApprovalTests/Features.md @@ -34,7 +34,15 @@ var actual = header.MakeHeading("I am ten chars"); var expected = ""; Approvals.AssertText(expected, actual); ``` -snippet source | anchor +snippet source | anchor + +```cs +var header = new Header(); +var actual = header.MakeHeading("I am ten chars"); +var expected = ""; +Approvals.AssertText(expected, actual); +``` +snippet source | anchor When you do this, it will copy the c# for the `.received.` to your clipboard, so you can paste it in-line. @@ -53,7 +61,20 @@ var expected = new[]{ }; Approvals.AssertText(expected, actual); ``` -snippet source | anchor +snippet source | anchor + +```cs +var header = new Header(); +var actual = header.MakeHeading("I am ten chars"); +var expected = new[]{ + "**************", + "I am ten chars", + "**************", + +}; +Approvals.AssertText(expected, actual); +``` +snippet source | anchor diff --git a/docs/ApprovalTests/ReportersGettingStarted.md b/docs/ApprovalTests/ReportersGettingStarted.md index b5280044..eae41059 100644 --- a/docs/ApprovalTests/ReportersGettingStarted.md +++ b/docs/ApprovalTests/ReportersGettingStarted.md @@ -34,7 +34,12 @@ ApprovalTests suggest you make a assembly level configuration file for approvalt ```cs [assembly: UseReporter(typeof(DiffReporter))] ``` -snippet source | anchor +snippet source | anchor + +```cs +[assembly: UseReporter(typeof(DiffReporter))] +``` +snippet source | anchor diff --git a/docs/ApprovalTests/explanations/MainConcepts.md b/docs/ApprovalTests/explanations/MainConcepts.md index 239b71f7..7cd8c986 100644 --- a/docs/ApprovalTests/explanations/MainConcepts.md +++ b/docs/ApprovalTests/explanations/MainConcepts.md @@ -63,7 +63,14 @@ Let's take the example: public void Text() => Approvals.Verify("should be approved"); ``` -snippet source | anchor +snippet source | anchor + +```cs +[Test] +public void Text() => + Approvals.Verify("should be approved"); +``` +snippet source | anchor This call brings together 3 things + default Approver to produce a `.received.` file which is compared to an `.approved.` file. diff --git a/docs/ApprovalTests/howtos/CustomizingDiffToolSelectionOrder.md b/docs/ApprovalTests/howtos/CustomizingDiffToolSelectionOrder.md index b0cf3d86..507bd0d1 100644 --- a/docs/ApprovalTests/howtos/CustomizingDiffToolSelectionOrder.md +++ b/docs/ApprovalTests/howtos/CustomizingDiffToolSelectionOrder.md @@ -44,7 +44,33 @@ public class CustomDiffReporter : } } ``` -snippet source | anchor +snippet source | anchor + +```cs +using ApprovalTests.Reporters.TestFrameworks; + +public class CustomDiffReporter : + FirstWorkingReporter +{ + public CustomDiffReporter() + : base( + //TODO: re-order or remove as required + BeyondCompareReporter.INSTANCE, + TortoiseDiffReporter.INSTANCE, + AraxisMergeReporter.INSTANCE, + P4MergeReporter.INSTANCE, + WinMergeReporter.INSTANCE, + KDiff3Reporter.INSTANCE, + VisualStudioReporter.INSTANCE, + RiderReporter.INSTANCE, + FrameworkAssertReporter.INSTANCE, + QuietReporter.INSTANCE + ) + { + } +} +``` +snippet source | anchor You can also override the default order while using `DiffReporter` by defining `DiffEngine_ToolOrder` environment variable. The value of that variable should contain a delimiter (`,`, `|`, ` `) separated list of the diff tool names in the desired order. More details about that in [Diff Tool Order](https://github.com/VerifyTests/DiffEngine/blob/main/docs/diff-tool.order.md) diff --git a/readme.md b/readme.md index 4689c373..57f47072 100644 --- a/readme.md +++ b/readme.md @@ -101,7 +101,23 @@ public class SampleTest } } ``` -snippet source | anchor +snippet source | anchor + +```cs +[UseReporter(typeof(VisualStudioReporter))] +[TestFixture] +public class SampleTest +{ + [Test] + public void TestList() + { + var names = new[] {"Llewellyn", "James", "Dan", "Jason", "Katrina"}; + Array.Sort(names); + Approvals.VerifyAll(names, label: ""); + } +} +``` +snippet source | anchor Will Produce a File @@ -117,7 +133,16 @@ Will Produce a File [3] = Katrina [4] = Llewellyn ``` -snippet source | anchor +snippet source | anchor + +```txt +[0] = Dan +[1] = James +[2] = Jason +[3] = Katrina +[4] = Llewellyn +``` +snippet source | anchor It will also open these 2 files (`.received.` & `.approved.` ) in a diff editor. diff --git a/src/ApprovalTests.NUnit3/ApprovalTests.NUnit3.csproj b/src/ApprovalTests.NUnit3/ApprovalTests.NUnit3.csproj new file mode 100644 index 00000000..aa292a46 --- /dev/null +++ b/src/ApprovalTests.NUnit3/ApprovalTests.NUnit3.csproj @@ -0,0 +1,26 @@ + + + + net48;net8.0 + full + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ApprovalTestsConfig.cs b/src/ApprovalTests.NUnit3/ApprovalTestsConfig.cs new file mode 100644 index 00000000..46c5404d --- /dev/null +++ b/src/ApprovalTests.NUnit3/ApprovalTestsConfig.cs @@ -0,0 +1,4 @@ +// begin-snippet: config_file + +[assembly: UseReporter(typeof(DiffReporter))] +// end-snippet \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.Dictionary.approved.txt b/src/ApprovalTests.NUnit3/ApprovalsTest.Dictionary.approved.txt new file mode 100644 index 00000000..4f60dd1a --- /dev/null +++ b/src/ApprovalTests.NUnit3/ApprovalsTest.Dictionary.approved.txt @@ -0,0 +1,11 @@ +Firefly + +2nd In Command => Zoey +Caption => Mal +Companion => Inara +Doctor => Simon +Mechanic => Kaylee +Muscle => Jayne +Pastor => Book +Pilot => Wash +Stowaway => River diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.DictionaryCustom.approved.txt b/src/ApprovalTests.NUnit3/ApprovalsTest.DictionaryCustom.approved.txt new file mode 100644 index 00000000..a24e291f --- /dev/null +++ b/src/ApprovalTests.NUnit3/ApprovalsTest.DictionaryCustom.approved.txt @@ -0,0 +1,11 @@ +Firefly + +"2nd In Command" => Zoey +"Caption" => Mal +"Companion" => Inara +"Doctor" => Simon +"Mechanic" => Kaylee +"Muscle" => Jayne +"Pastor" => Book +"Pilot" => Wash +"Stowaway" => River diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.DictionaryCustomNoHeader.approved.txt b/src/ApprovalTests.NUnit3/ApprovalsTest.DictionaryCustomNoHeader.approved.txt new file mode 100644 index 00000000..2a713d0b --- /dev/null +++ b/src/ApprovalTests.NUnit3/ApprovalsTest.DictionaryCustomNoHeader.approved.txt @@ -0,0 +1,9 @@ +"2nd In Command" => Zoey +"Caption" => Mal +"Companion" => Inara +"Doctor" => Simon +"Mechanic" => Kaylee +"Muscle" => Jayne +"Pastor" => Book +"Pilot" => Wash +"Stowaway" => River diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.DictionarySimple.approved.txt b/src/ApprovalTests.NUnit3/ApprovalsTest.DictionarySimple.approved.txt new file mode 100644 index 00000000..636f9680 --- /dev/null +++ b/src/ApprovalTests.NUnit3/ApprovalsTest.DictionarySimple.approved.txt @@ -0,0 +1,9 @@ +2nd In Command => Zoey +Caption => Mal +Companion => Inara +Doctor => Simon +Mechanic => Kaylee +Muscle => Jayne +Pastor => Book +Pilot => Wash +Stowaway => River diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithFormatter.approved.txt b/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithFormatter.approved.txt new file mode 100644 index 00000000..8c175351 --- /dev/null +++ b/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithFormatter.approved.txt @@ -0,0 +1,3 @@ +3 +3 +3 diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithHeaderAndFormatter.approved.txt b/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithHeaderAndFormatter.approved.txt new file mode 100644 index 00000000..f16360c1 --- /dev/null +++ b/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithHeaderAndFormatter.approved.txt @@ -0,0 +1,11 @@ +Llewellyn + +L => 76 +l => 108 +e => 101 +w => 119 +e => 101 +l => 108 +l => 108 +y => 121 +n => 110 diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithLabel.approved.txt b/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithLabel.approved.txt new file mode 100644 index 00000000..a77679dd --- /dev/null +++ b/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithLabel.approved.txt @@ -0,0 +1,3 @@ +collection[0] = abc +collection[1] = 123 +collection[2] = !@# diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithLabelAndFormatter.approved.txt b/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithLabelAndFormatter.approved.txt new file mode 100644 index 00000000..05bba2d4 --- /dev/null +++ b/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithLabelAndFormatter.approved.txt @@ -0,0 +1,3 @@ +collection[0] = 3 +collection[1] = 3 +collection[2] = 3 diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.JsonText.approved.json b/src/ApprovalTests.NUnit3/ApprovalsTest.JsonText.approved.json new file mode 100644 index 00000000..65585d56 --- /dev/null +++ b/src/ApprovalTests.NUnit3/ApprovalsTest.JsonText.approved.json @@ -0,0 +1,15 @@ +{ + "GivenNames": "John", + "FamilyName": "Smith", + "Spouse": "Jill", + "Address": { + "Street": "1 Puddle Lane", + "Suburb": null, + "Country": "USA" + }, + "Children": [ + "Sam", + "Mary" + ], + "Title": "Mr" +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.TestBytes.approved.png b/src/ApprovalTests.NUnit3/ApprovalsTest.TestBytes.approved.png new file mode 100644 index 0000000000000000000000000000000000000000..82d622f253d714d9c86c3470ec7de961b6ac750b GIT binary patch literal 417 zcmV;S0bc%zP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUzA4x<(RA@u(Sj!HAKn%qH|1pmq{2vA4np*l=6Ua0f5-v-@GLO#6 z?fJOB79KbVY=rQ{!C>i5#wu-7P~JNF`?e%Rg54E(PZ%TwY-Aq@*%UXWu2G z`{kNciT7MfNwU9jpVhPeee`j)Z?K{!<;z;&>2YDzS86^xy*&%O`iwkHbfp(Wf+cB7RMQHFFS;wvamc@@=G)E_DSU+`uLv7CqKj>E{R06a@nHiBlaYjCrkyY0xz zBWpJ7wexi7df`3*_v*c@h}N@bA-Scr?X~83r!jy8c-9LELH{3;G05xZe)lRlge06x z!cX23?CZd;U`>ZGL$DNCQSFsAbO;?nheVE}L+B7Xgbo37K}5(KMK}zxR& + Approvals.Verify("should be approved"); + // end-snippet + + [Test] + public void VerifyWithExtension() => + Approvals.VerifyWithExtension("should,be,approved", ".csv"); + + [Test] + public void EnumerableWithLabel() => + Approvals.VerifyAll(text, "collection"); + + [Test] + public void TestExistingFile() + { + var path = PathUtilities.GetDirectoryForCaller(); + var copy = path + "copyOfa.txt"; + File.Copy(path + "a.txt", copy, true); + Approvals.VerifyFile(copy); + } + + [Test] + public void TestBytes() + { + var path = PathUtilities.GetDirectoryForCaller(); + Approvals.VerifyBinaryFile(File.ReadAllBytes(path + "a.png"), "png"); + } + + [Test] + public void EnumerableWithLabelAndFormatter() => + Approvals.VerifyAll(text, "collection", t => "" + t.Length); + + [Test] + public void EnumerableWithHeaderAndFormatter() + { + var word = "Llewellyn"; + Approvals.VerifyAll(word, word.ToCharArray(), c => c + " => " + (int) c); + } + + [Test] + public void VerifyAllWithNull() + { + var words = new[] {"abc", null, "123", "!@#"}; + Approvals.VerifyAll(words, ""); + } + + [Test] + public void VerifyAllNull() + { + string[] words = null; + Approvals.VerifyAll(words, "words"); + } + + [Test] + public void VerifyNullDictionary() + { + Dictionary words = null; + Approvals.VerifyAll(words); + } + + [Test] + public void DictionarySimple() => + Approvals.VerifyAll(FireFlyMap()); + + [Test] + public void Dictionary() => + Approvals.VerifyAll("Firefly", FireFlyMap()); + + [Test] + public void DictionaryCustom() => + Approvals.VerifyAll("Firefly", FireFlyMap(), (k, v) => $"\"{k}\" => {v}"); + + [Test] + public void DictionaryCustomNoHeader() => + Approvals.VerifyAll(FireFlyMap(), (k, v) => $"\"{k}\" => {v}"); + + static Dictionary FireFlyMap() => + new() + { + {"Caption", "Mal"}, + {"2nd In Command", "Zoey"}, + {"Pilot", "Wash"}, + {"Companion", "Inara"}, + {"Muscle", "Jayne"}, + {"Mechanic", "Kaylee"}, + {"Doctor", "Simon"}, + {"Pastor", "Book"}, + {"Stowaway", "River"} + }; + + [Test] + public void EnumerableWithFormatter() => + Approvals.VerifyAll(text, t => "" + t.Length); + + [Test] + public void JsonText() + { + var json = """{"GivenNames":"John","FamilyName":"Smith","Spouse":"Jill","Address":{"Street":"1 Puddle Lane","Suburb":null,"Country":"USA"},"Children":["Sam","Mary"],"Title":"Mr"}"""; + Approvals.VerifyJson(json); + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Async/AsyncTests.TestAsync.approved.txt b/src/ApprovalTests.NUnit3/Async/AsyncTests.TestAsync.approved.txt new file mode 100644 index 00000000..28fcd99e --- /dev/null +++ b/src/ApprovalTests.NUnit3/Async/AsyncTests.TestAsync.approved.txt @@ -0,0 +1 @@ +This came asynchronously \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Async/AsyncTests.cs b/src/ApprovalTests.NUnit3/Async/AsyncTests.cs new file mode 100644 index 00000000..b66a9814 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Async/AsyncTests.cs @@ -0,0 +1,17 @@ +[TestFixture] +[UseReporter(typeof(MachineSpecificReporter))] +public class AsyncTests +{ + [Test] + public async Task TestAsync() + { + var text = await AsyncMethod(); + Approvals.Verify(text); + } + + static async Task AsyncMethod() + { + await Task.Delay(1); + return "This came asynchronously"; + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/CleanupReporter.cs b/src/ApprovalTests.NUnit3/CleanupReporter.cs new file mode 100644 index 00000000..e8eb1e37 --- /dev/null +++ b/src/ApprovalTests.NUnit3/CleanupReporter.cs @@ -0,0 +1,7 @@ +public class CleanupReporter : IApprovalFailureReporter +{ + public void Report(string approved, string received) => + File.Delete(received); + + public bool ApprovedWhenReported() => false; +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/CombinationApprovalsTests.cs b/src/ApprovalTests.NUnit3/CombinationApprovalsTests.cs new file mode 100644 index 00000000..a8438343 --- /dev/null +++ b/src/ApprovalTests.NUnit3/CombinationApprovalsTests.cs @@ -0,0 +1,12 @@ +public class CombinationApprovalsTests +{ + [Test] + [SetCulture("es-ES")] + public void ArgsShouldBeReportedInInvariantCulture() + { + var dateTime = new DateTime(2000, 5, 22, 13, 43, 21); + var result = CombinationApprovals.GetApprovalString(_ => "test", Enumerable.Repeat(dateTime, 1)); + var invariantDate = dateTime.ToString(CultureInfo.InvariantCulture); + StringAssert.Contains(invariantDate, result); + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Events/EventApprovalsTest.MulticastPoco.approved.txt b/src/ApprovalTests.NUnit3/Events/EventApprovalsTest.MulticastPoco.approved.txt new file mode 100644 index 00000000..484b0436 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Events/EventApprovalsTest.MulticastPoco.approved.txt @@ -0,0 +1,6 @@ +Event Configuration for TestingEventPoco + +MyEvent: + [0] Void AnotherStandardCallback(System.Object, System.EventArgs) + [1] Void StandardCallback(System.Object, System.EventArgs) + diff --git a/src/ApprovalTests.NUnit3/Events/EventApprovalsTest.UnicastPoco.approved.txt b/src/ApprovalTests.NUnit3/Events/EventApprovalsTest.UnicastPoco.approved.txt new file mode 100644 index 00000000..92e5a793 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Events/EventApprovalsTest.UnicastPoco.approved.txt @@ -0,0 +1,8 @@ +Event Configuration for TestingEventPoco + +MyEvent: + [0] Void StandardCallback(System.Object, System.EventArgs) + +PropertyChanged: + [0] Void PropertyChangedCallback(System.Object, System.ComponentModel.PropertyChangedEventArgs) + diff --git a/src/ApprovalTests.NUnit3/Events/EventApprovalsTest.cs b/src/ApprovalTests.NUnit3/Events/EventApprovalsTest.cs new file mode 100644 index 00000000..95614477 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Events/EventApprovalsTest.cs @@ -0,0 +1,21 @@ +[TestFixture] +public class EventApprovalsTest +{ + [Test] + public void MulticastPoco() + { + var testingPoco = new TestingEventPoco(); + testingPoco.MyEvent += TestingListener.AnotherStandardCallback; + testingPoco.MyEvent += TestingListener.StandardCallback; + EventApprovals.VerifyEvents(testingPoco); + } + + [Test] + public void UnicastPoco() + { + var testingPoco = new TestingEventPoco(); + testingPoco.MyEvent += TestingListener.StandardCallback; + testingPoco.PropertyChanged += TestingListener.PropertyChangedCallback; + EventApprovals.VerifyEvents(testingPoco); + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Events/TestingEventPoco.cs b/src/ApprovalTests.NUnit3/Events/TestingEventPoco.cs new file mode 100644 index 00000000..05420e50 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Events/TestingEventPoco.cs @@ -0,0 +1,20 @@ +using System.ComponentModel; + +public class TestingEventPoco : INotifyPropertyChanged +{ + readonly object NonEventField = new(); + + public event EventHandler MyEvent; + +#pragma warning disable 67 + + public event PropertyChangedEventHandler PropertyChanged; + +#pragma warning restore 67 + + protected virtual void OnMyEvent(object sender, EventArgs e) + { + var handler = MyEvent; + handler?.Invoke(sender, e); + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Events/TestingListener.cs b/src/ApprovalTests.NUnit3/Events/TestingListener.cs new file mode 100644 index 00000000..cc0c9c7b --- /dev/null +++ b/src/ApprovalTests.NUnit3/Events/TestingListener.cs @@ -0,0 +1,12 @@ +public static class TestingListener +{ + public static void AnotherStandardCallback(object sender, EventArgs e) => + throw new NotImplementedException(); + + public static void PropertyChangedCallback(object sender, System.ComponentModel.PropertyChangedEventArgs e) + { + } + + public static void StandardCallback(object sender, EventArgs e) => + throw new NotImplementedException(); +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyException.approved.txt b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyException.approved.txt new file mode 100644 index 00000000..6a16afc1 --- /dev/null +++ b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyException.approved.txt @@ -0,0 +1 @@ +System.Exception: The Message \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Education.approved.txt b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Education.approved.txt new file mode 100644 index 00000000..b2144ff3 --- /dev/null +++ b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Education.approved.txt @@ -0,0 +1,3 @@ +System.Exception: https:.../242 + at ExceptionTests.<>c.() in ...\ExceptionTests.cs + at ApprovalUtilities.Utilities.ExceptionUtilities.GetException(Action action) in ...\ExceptionUtilities.cs \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Enterprise.approved.txt b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Enterprise.approved.txt new file mode 100644 index 00000000..b2144ff3 --- /dev/null +++ b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Enterprise.approved.txt @@ -0,0 +1,3 @@ +System.Exception: https:.../242 + at ExceptionTests.<>c.() in ...\ExceptionTests.cs + at ApprovalUtilities.Utilities.ExceptionUtilities.GetException(Action action) in ...\ExceptionUtilities.cs \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Home_N.approved.txt b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Home_N.approved.txt new file mode 100644 index 00000000..b2144ff3 --- /dev/null +++ b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Home_N.approved.txt @@ -0,0 +1,3 @@ +System.Exception: https:.../242 + at ExceptionTests.<>c.() in ...\ExceptionTests.cs + at ApprovalUtilities.Utilities.ExceptionUtilities.GetException(Action action) in ...\ExceptionUtilities.cs \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Pro.approved.txt b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Pro.approved.txt new file mode 100644 index 00000000..b2144ff3 --- /dev/null +++ b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Pro.approved.txt @@ -0,0 +1,3 @@ +System.Exception: https:.../242 + at ExceptionTests.<>c.() in ...\ExceptionTests.cs + at ApprovalUtilities.Utilities.ExceptionUtilities.GetException(Action action) in ...\ExceptionUtilities.cs \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_11_Enterprise.approved.txt b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_11_Enterprise.approved.txt new file mode 100644 index 00000000..b2144ff3 --- /dev/null +++ b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_11_Enterprise.approved.txt @@ -0,0 +1,3 @@ +System.Exception: https:.../242 + at ExceptionTests.<>c.() in ...\ExceptionTests.cs + at ApprovalUtilities.Utilities.ExceptionUtilities.GetException(Action action) in ...\ExceptionUtilities.cs \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_11_Pro.approved.txt b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_11_Pro.approved.txt new file mode 100644 index 00000000..b2144ff3 --- /dev/null +++ b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_11_Pro.approved.txt @@ -0,0 +1,3 @@ +System.Exception: https:.../242 + at ExceptionTests.<>c.() in ...\ExceptionTests.cs + at ApprovalUtilities.Utilities.ExceptionUtilities.GetException(Action action) in ...\ExceptionUtilities.cs \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_Server_2016_Datacenter.approved.txt b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_Server_2016_Datacenter.approved.txt new file mode 100644 index 00000000..b2144ff3 --- /dev/null +++ b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_Server_2016_Datacenter.approved.txt @@ -0,0 +1,3 @@ +System.Exception: https:.../242 + at ExceptionTests.<>c.() in ...\ExceptionTests.cs + at ApprovalUtilities.Utilities.ExceptionUtilities.GetException(Action action) in ...\ExceptionUtilities.cs \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_Server_2019_Datacenter.approved.txt b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_Server_2019_Datacenter.approved.txt new file mode 100644 index 00000000..b2144ff3 --- /dev/null +++ b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_Server_2019_Datacenter.approved.txt @@ -0,0 +1,3 @@ +System.Exception: https:.../242 + at ExceptionTests.<>c.() in ...\ExceptionTests.cs + at ApprovalUtilities.Utilities.ExceptionUtilities.GetException(Action action) in ...\ExceptionUtilities.cs \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.cs b/src/ApprovalTests.NUnit3/ExceptionTests.cs new file mode 100644 index 00000000..7e1012d9 --- /dev/null +++ b/src/ApprovalTests.NUnit3/ExceptionTests.cs @@ -0,0 +1,28 @@ +[TestFixture] +[UseReporter(typeof(MachineSpecificReporter))] +public class ExceptionTests +{ + +#if NET6_0_OR_GREATER + + [Test] + public void VerifyExceptionWithStacktrace() + { + using (ApprovalResults.UniqueForOs()) + { + Action wrapper = () => throw new("https://github.com/approvals/ApprovalTests.Net/issues/242"); + var e = ExceptionUtilities.GetException(wrapper); + Approvals.VerifyExceptionWithStacktrace(e); + } + } + +#endif + + [Test] + public void VerifyException() + { + Action wrapper = () => throw new("The Message"); + var e = ExceptionUtilities.GetException(wrapper); + Approvals.VerifyException(e); + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailure.Inner.approved.txt b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailure.Inner.approved.txt new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailure.Inner.approved.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailure.approved.txt b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailure.approved.txt new file mode 100644 index 00000000..51e25404 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailure.approved.txt @@ -0,0 +1 @@ +Increased feedback on[0] = Sam diff --git a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailureWithPreviousApproval.Inner.approved.txt b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailureWithPreviousApproval.Inner.approved.txt new file mode 100644 index 00000000..74c82f0d --- /dev/null +++ b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailureWithPreviousApproval.Inner.approved.txt @@ -0,0 +1 @@ +I am diff --git a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailureWithPreviousApproval.approved.txt b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailureWithPreviousApproval.approved.txt new file mode 100644 index 00000000..ee925b50 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailureWithPreviousApproval.approved.txt @@ -0,0 +1,2 @@ +Increased feedback on[0] = Sam +Increased feedback on[1] = I am diff --git a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableSuccess.Inner.approved.txt b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableSuccess.Inner.approved.txt new file mode 100644 index 00000000..3ac8656d --- /dev/null +++ b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableSuccess.Inner.approved.txt @@ -0,0 +1 @@ +Sam \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableSuccess.approved.txt b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableSuccess.approved.txt new file mode 100644 index 00000000..f16c5fdd --- /dev/null +++ b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableSuccess.approved.txt @@ -0,0 +1 @@ +Increased feedback on is empty \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.cs b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.cs new file mode 100644 index 00000000..35c90b92 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.cs @@ -0,0 +1,47 @@ +[TestFixture] +[UseReporter(typeof(QuietReporter))] +public class ExecutableTest +{ + static List RunExecutableApproval() + { + var output = new List(); + + try + { + NamerFactory.AdditionalInformation = "Inner"; + Approvals.VerifyWithCallback("Sam", s => output.Add(s)); + } + catch (Exception) + { + } + + return output; + } + + [Test] + public void TestExecutableFailure() + { + using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) + { + Approvals.VerifyAll(RunExecutableApproval(), "Increased feedback on"); + } + } + + [Test] + public void TestExecutableFailureWithPreviousApproval() + { + using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) + { + Approvals.VerifyAll(RunExecutableApproval(), "Increased feedback on"); + } + } + + [Test] + public void TestExecutableSuccess() + { + using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) + { + Approvals.VerifyAll(RunExecutableApproval(), "Increased feedback on"); + } + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/FailedApprovalTests.EnumerableDoesNotMatchApproval.approved.txt b/src/ApprovalTests.NUnit3/FailedApprovalTests.EnumerableDoesNotMatchApproval.approved.txt new file mode 100644 index 00000000..93ac1f7e --- /dev/null +++ b/src/ApprovalTests.NUnit3/FailedApprovalTests.EnumerableDoesNotMatchApproval.approved.txt @@ -0,0 +1 @@ +collection[0] = Does match diff --git a/src/ApprovalTests.NUnit3/FailedApprovalTests.TextDoesNotMatchApproval.approved.txt b/src/ApprovalTests.NUnit3/FailedApprovalTests.TextDoesNotMatchApproval.approved.txt new file mode 100644 index 00000000..33bf5a1d --- /dev/null +++ b/src/ApprovalTests.NUnit3/FailedApprovalTests.TextDoesNotMatchApproval.approved.txt @@ -0,0 +1 @@ +should pass diff --git a/src/ApprovalTests.NUnit3/FailedApprovalTests.cs b/src/ApprovalTests.NUnit3/FailedApprovalTests.cs new file mode 100644 index 00000000..0fbd7887 --- /dev/null +++ b/src/ApprovalTests.NUnit3/FailedApprovalTests.cs @@ -0,0 +1,32 @@ +[TestFixture] +[UseReporter(typeof(CleanupReporter))] +public class FailedApprovalTests +{ + static void AssertThrows(TestDelegate code) where T : Exception + { + using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) + { + Assert.Throws(code); + } + } + + [Test] + public void EnumerableDoesNotMatchApproval() => + AssertThrows(() => + Approvals.VerifyAll(new[] {"Does not match"}, "collection")); + + [Test] + public void EnumerableNotApprovedYet() => + AssertThrows(() => + Approvals.VerifyAll(new[] {"Not approved"}, "collection")); + + [Test] + public void TextDoesNotMatchApproval() => + AssertThrows(() => + Approvals.Verify("should fail with mismatch")); + + [Test] + public void TextNotApprovedYet() => + AssertThrows(() => + Approvals.Verify("should fail with a missing exception")); +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/FileApproverTests.cs b/src/ApprovalTests.NUnit3/FileApproverTests.cs new file mode 100644 index 00000000..097ce01a --- /dev/null +++ b/src/ApprovalTests.NUnit3/FileApproverTests.cs @@ -0,0 +1,46 @@ +[TestFixture] +public class FileApproverTests +{ + [Test] + public void TestFailureDueToMissingApproval() => + AssertApprover("a.txt", "non_existing_file.txt", false); + + [Test] + public void TestFailureDueToMismatch() => + AssertApprover("a.txt", "b.txt", false); + + [Test] + public void TestSuccess() => + AssertApprover("a.txt", "a.txt", true); + + [Test] + public void LineEndingsAreIgnored() + { + var basePath = PathUtilities.GetDirectoryForCaller(); + var approvedFile = basePath + "UnixLineEndings.txt"; + var receivedFile = basePath + "WindowsLineEndings.txt"; + File.WriteAllText(approvedFile, "Foo\nBar"); + File.WriteAllText(receivedFile, "Foo\r\nBar"); + var fileApprover = new FileApprover(null, null, true).Approve(approvedFile, receivedFile); + Assert.IsNull(fileApprover); + } + + [Test] + public void LineEndingAreNotIgnored() + { + var basePath = PathUtilities.GetDirectoryForCaller(); + var approvedFile = basePath + "UnixLineEndings.txt"; + var receivedFile = basePath + "WindowsLineEndings.txt"; + File.WriteAllText(approvedFile, "Foo\nBar"); + File.WriteAllText(receivedFile, "Foo\r\nBar"); + var fileApprover = new FileApprover(null, null).Approve(approvedFile, receivedFile); + Assert.IsInstanceOf(fileApprover); + } + + static void AssertApprover(string receivedFile, string approvedFile, bool expected) + { + var basePath = PathUtilities.GetDirectoryForCaller(); + var fileApprover = new FileApprover(null, null).Approve(basePath + approvedFile, basePath + receivedFile); + Assert.AreEqual(expected, fileApprover == null); + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/GlobalUsings.cs b/src/ApprovalTests.NUnit3/GlobalUsings.cs new file mode 100644 index 00000000..42300ac5 --- /dev/null +++ b/src/ApprovalTests.NUnit3/GlobalUsings.cs @@ -0,0 +1,26 @@ +global using System.Diagnostics; +global using System.Globalization; +global using System.Net; +global using System.Runtime.CompilerServices; +global using ApprovalTests; +global using ApprovalTests.Approvers; +global using ApprovalTests.Combinations; +global using ApprovalTests.Core; +global using ApprovalTests.Core.Exceptions; +global using ApprovalTests.Email; +global using ApprovalTests.Events; +global using ApprovalTests.ExceptionalExceptions; +global using ApprovalTests.Maintenance; +global using ApprovalTests.Namers; +global using ApprovalTests.Namers.StackTraceParsers; +global using ApprovalTests.Reporters; +global using ApprovalTests.Scrubber; +global using ApprovalTests.Utilities; +global using ApprovalTests.WindowsRegistry; +global using ApprovalUtilities.Persistence; +global using ApprovalUtilities.SimpleLogger; +global using ApprovalUtilities.Utilities; +global using iText.Kernel.Pdf; +global using iText.Layout; +global using iText.Layout.Element; +global using NUnit.Framework; \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Issues/CustomNamerShouldBeSubstitutableTest.CustomNamerShouldBeSubstitutable.approved.txt b/src/ApprovalTests.NUnit3/Issues/CustomNamerShouldBeSubstitutableTest.CustomNamerShouldBeSubstitutable.approved.txt new file mode 100644 index 00000000..e3b8c23e --- /dev/null +++ b/src/ApprovalTests.NUnit3/Issues/CustomNamerShouldBeSubstitutableTest.CustomNamerShouldBeSubstitutable.approved.txt @@ -0,0 +1 @@ +CustomNamerShouldBeSubstitutable \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Issues/CustomNamerShouldBeSubstitutableTest.cs b/src/ApprovalTests.NUnit3/Issues/CustomNamerShouldBeSubstitutableTest.cs new file mode 100644 index 00000000..09331db5 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Issues/CustomNamerShouldBeSubstitutableTest.cs @@ -0,0 +1,43 @@ +using ApprovalTests.Writers; +using ApprovalUtilities.CallStack; + +[TestFixture] +public class CustomNamerShouldBeSubstitutableTest +{ + /// + /// Test for Issue #140 + /// https://github.com/approvals/ApprovalTests.Net/issues/140 + /// + [Test] + public void CustomNamerShouldNotDependOnSetCallerTest() + { + var approvalText = "CustomNamerShouldBeSubstitutable"; + + var writer = WriterFactory.CreateTextWriter(approvalText); + var namer = new CustomNamer(); + var reporter = new MethodLevelReporter(); + + Approvals.Verify(writer, namer, reporter); + } + + [Test] + public void CustomNamerShouldBeSubstitutable() + { + // just here to prevent false detection as abandoned file via Maintenance test + } + + class CustomNamer : IApprovalNamer + { + public string Name => "CustomNamerShouldBeSubstitutableTest.CustomNamerShouldBeSubstitutable"; + + public string SourcePath + { + get + { + var stackTraceParser = new StackTraceParser(); + stackTraceParser.Parse(new Caller().StackTrace); + return stackTraceParser.SourcePath; + } + } + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Mac.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Mac.approved.txt new file mode 100644 index 00000000..92cea9fb --- /dev/null +++ b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Mac.approved.txt @@ -0,0 +1,4 @@ +[0,0] => Division by zero +[0,2] => 0 +[2,0] => Division by zero +[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Education.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Education.approved.txt new file mode 100644 index 00000000..2b752a46 --- /dev/null +++ b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Education.approved.txt @@ -0,0 +1,4 @@ +[0,0] => Attempted to divide by zero. +[0,2] => 0 +[2,0] => Attempted to divide by zero. +[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Enterprise.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Enterprise.approved.txt new file mode 100644 index 00000000..2b752a46 --- /dev/null +++ b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Enterprise.approved.txt @@ -0,0 +1,4 @@ +[0,0] => Attempted to divide by zero. +[0,2] => 0 +[2,0] => Attempted to divide by zero. +[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Home_N.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Home_N.approved.txt new file mode 100644 index 00000000..2b752a46 --- /dev/null +++ b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Home_N.approved.txt @@ -0,0 +1,4 @@ +[0,0] => Attempted to divide by zero. +[0,2] => 0 +[2,0] => Attempted to divide by zero. +[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Pro.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Pro.approved.txt new file mode 100644 index 00000000..2b752a46 --- /dev/null +++ b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Pro.approved.txt @@ -0,0 +1,4 @@ +[0,0] => Attempted to divide by zero. +[0,2] => 0 +[2,0] => Attempted to divide by zero. +[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_11_Enterprise.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_11_Enterprise.approved.txt new file mode 100644 index 00000000..2b752a46 --- /dev/null +++ b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_11_Enterprise.approved.txt @@ -0,0 +1,4 @@ +[0,0] => Attempted to divide by zero. +[0,2] => 0 +[2,0] => Attempted to divide by zero. +[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_11_Pro.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_11_Pro.approved.txt new file mode 100644 index 00000000..2b752a46 --- /dev/null +++ b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_11_Pro.approved.txt @@ -0,0 +1,4 @@ +[0,0] => Attempted to divide by zero. +[0,2] => 0 +[2,0] => Attempted to divide by zero. +[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_Server_2016_Datacenter.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_Server_2016_Datacenter.approved.txt new file mode 100644 index 00000000..2b752a46 --- /dev/null +++ b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_Server_2016_Datacenter.approved.txt @@ -0,0 +1,4 @@ +[0,0] => Attempted to divide by zero. +[0,2] => 0 +[2,0] => Attempted to divide by zero. +[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_Server_2019_Datacenter.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_Server_2019_Datacenter.approved.txt new file mode 100644 index 00000000..2b752a46 --- /dev/null +++ b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_Server_2019_Datacenter.approved.txt @@ -0,0 +1,4 @@ +[0,0] => Attempted to divide by zero. +[0,2] => 0 +[2,0] => Attempted to divide by zero. +[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Windows_7.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Windows_7.approved.txt new file mode 100644 index 00000000..2b752a46 --- /dev/null +++ b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Windows_7.approved.txt @@ -0,0 +1,4 @@ +[0,0] => Attempted to divide by zero. +[0,2] => 0 +[2,0] => Attempted to divide by zero. +[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Windows_8.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Windows_8.approved.txt new file mode 100644 index 00000000..2b752a46 --- /dev/null +++ b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Windows_8.approved.txt @@ -0,0 +1,4 @@ +[0,0] => Attempted to divide by zero. +[0,2] => 0 +[2,0] => Attempted to divide by zero. +[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestLockDown.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestLockDown.approved.txt new file mode 100644 index 00000000..531362be --- /dev/null +++ b/src/ApprovalTests.NUnit3/LockDownTests.TestLockDown.approved.txt @@ -0,0 +1,512 @@ +[1,1,1,1,1,1,1,1,1] => [1, 1, 1, 1, 1, 1, 1, 1, 1] +[1,1,1,1,1,1,1,1,2] => [1, 1, 1,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2,1,1] => [2, 2, 2, 2, 1, 2, 2, 1, 1] +[2,2,2,2,1,2,2,1,2] => [2, 2, 2, 2, 1, 2, 2, 1, 2] +[2,2,2,2,1,2,2,2,1] => [2, 2, 2, 2, 1, 2, 2, 2, 1] +[2,2,2,2,1,2,2,2,2] => [2, 2, 2, 2, 1, 2, 2, 2, 2] +[2,2,2,2,2,1,1,1,1] => [2, 2, 2, 2, 2, 1, 1, 1, 1] +[2,2,2,2,2,1,1,1,2] => [2, 2, 2, 2, 2, 1, 1, 1, 2] +[2,2,2,2,2,1,1,2,1] => [2, 2, 2, 2, 2, 1, 1, 2, 1] +[2,2,2,2,2,1,1,2,2] => [2, 2, 2, 2, 2, 1, 1, 2, 2] +[2,2,2,2,2,1,2,1,1] => [2, 2, 2, 2, 2, 1, 2, 1, 1] +[2,2,2,2,2,1,2,1,2] => [2, 2, 2, 2, 2, 1, 2, 1, 2] +[2,2,2,2,2,1,2,2,1] => [2, 2, 2, 2, 2, 1, 2, 2, 1] +[2,2,2,2,2,1,2,2,2] => [2, 2, 2, 2, 2, 1, 2, 2, 2] +[2,2,2,2,2,2,1,1,1] => [2, 2, 2, 2, 2, 2, 1, 1, 1] +[2,2,2,2,2,2,1,1,2] => [2, 2, 2, 2, 2, 2, 1, 1, 2] +[2,2,2,2,2,2,1,2,1] => [2, 2, 2, 2, 2, 2, 1, 2, 1] +[2,2,2,2,2,2,1,2,2] => [2, 2, 2, 2, 2, 2, 1, 2, 2] +[2,2,2,2,2,2,2,1,1] => [2, 2, 2, 2, 2, 2, 2, 1, 1] +[2,2,2,2,2,2,2,1,2] => [2, 2, 2, 2, 2, 2, 2, 1, 2] +[2,2,2,2,2,2,2,2,1] => [2, 2, 2, 2, 2, 2, 2, 2, 1] +[2,2,2,2,2,2,2,2,2] => [2, 2, 2, 2, 2, 2, 2, 2, 2] diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestLockDown2.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestLockDown2.approved.txt new file mode 100644 index 00000000..5ae2d335 --- /dev/null +++ b/src/ApprovalTests.NUnit3/LockDownTests.TestLockDown2.approved.txt @@ -0,0 +1,4 @@ +[1,1] => [1, 1] +[1,2] => [1, 2] +[2,1] => [2, 1] +[2,2] => [2, 2] diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestLockDown8.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestLockDown8.approved.txt new file mode 100644 index 00000000..58203bf7 --- /dev/null +++ b/src/ApprovalTests.NUnit3/LockDownTests.TestLockDown8.approved.txt @@ -0,0 +1,256 @@ +[1,1,1,1,1,1,1,1] => [1, 1, 1, 1, 1, 1, 1, 1] +[1,1,1,1,1,1,1,2] => [1, 1, 1, 1, 1, 1, 1, 2] +[1,1,1,1,1,1,2,1] => [1, 1, 1, 1, 1, 1, 2, 1] +[1,1,1,1,1,1,2,2] => [1, 1, 1, 1, 1, 1, 2, 2] +[1,1,1,1,1,2,1,1] => [1, 1, 1, 1, 1, 2, 1, 1] +[1,1,1,1,1,2,1,2] => [1, 1, 1, 1, 1, 2, 1, 2] +[1,1,1,1,1,2,2,1] => [1, 1, 1, 1, 1, 2, 2, 1] +[1,1,1,1,1,2,2,2] => [1, 1, 1, 1, 1, 2, 2, 2] +[1,1,1,1,2,1,1,1] => [1, 1, 1, 1, 2, 1, 1, 1] +[1,1,1,1,2,1,1,2] => [1, 1, 1, 1, 2, 1, 1, 2] +[1,1,1,1,2,1,2,1] => [1, 1, 1, 1, 2, 1, 2, 1] +[1,1,1,1,2,1,2,2] => [1, 1, 1, 1, 2, 1, 2, 2] +[1,1,1,1,2,2,1,1] => [1, 1, 1, 1, 2, 2, 1, 1] +[1,1,1,1,2,2,1,2] => [1, 1, 1, 1, 2, 2, 1, 2] +[1,1,1,1,2,2,2,1] => [1, 1, 1, 1, 2, 2, 2, 1] +[1,1,1,1,2,2,2,2] => [1, 1, 1, 1, 2, 2, 2, 2] +[1,1,1,2,1,1,1,1] => [1, 1, 1, 2, 1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, 1] +[2,2,2,2,2,2,2,2] => [2, 2, 2, 2, 2, 2, 2, 2] diff --git a/src/ApprovalTests.NUnit3/LockDownTests.cs b/src/ApprovalTests.NUnit3/LockDownTests.cs new file mode 100644 index 00000000..29b8c44d --- /dev/null +++ b/src/ApprovalTests.NUnit3/LockDownTests.cs @@ -0,0 +1,39 @@ +[TestFixture] +[UseReporter(typeof(DiffReporter))] +public class LockDownTests +{ + public string Echo(params int[] i) => + i.ToReadableString(); + + [Test] + public void TestLockDown() + { + int[] n = [1, 2]; + CombinationApprovals.VerifyAllCombinations((a, b, c, d, e, f, g, h, i) => Echo(a, b, c, d, e, f, g, h, i), n, n, n, n, n, n, n, n, n); + } + + [Test] + public void TestLockDown8() + { + int[] n = [1, 2]; + CombinationApprovals.VerifyAllCombinations((a, b, c, d, e, f, g, h) => Echo(a, b, c, d, e, f, g, h), n, n, n, n, n, n, n, n); + } + + [Test] + public void TestLockDown2() + { + int[] n = [1, 2]; + CombinationApprovals.VerifyAllCombinations((a, b) => Echo(a, b), n, n); + } + + [Test] + [UseReporter(typeof(MachineSpecificReporter))] + public void TestExceptions() + { + using (ApprovalResults.UniqueForOs()) + { + int[] n = [0, 2]; + CombinationApprovals.VerifyAllCombinations((a, b) => a / b, n, n); + } + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.FindAbandonedApprovalFiles.approved.txt b/src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.FindAbandonedApprovalFiles.approved.txt new file mode 100644 index 00000000..d4a28cd0 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.FindAbandonedApprovalFiles.approved.txt @@ -0,0 +1,3 @@ +Abandoned Files: + +DeletedClass.AbandonedMethod.approved.txt diff --git a/src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.Nested.MethodName.approved.txt b/src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.Nested.MethodName.approved.txt new file mode 100644 index 00000000..5dd999ac --- /dev/null +++ b/src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.Nested.MethodName.approved.txt @@ -0,0 +1 @@ +aaa \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.cs b/src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.cs new file mode 100644 index 00000000..96052e98 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.cs @@ -0,0 +1,21 @@ +[TestFixture] +public class ApprovalMaintenanceTest +{ + [Test] + public void FindAbandonedApprovalFiles() + { + using var t = new TempFile(PathUtilities.GetAdjacentFile("DeletedClass.AbandonedMethod.approved.txt")); + t.WriteAllText("Llewellyn was here"); + var path = PathUtilities.GetDirectoryForCaller(); + var list = ApprovalMaintenance.FindAbandonedFiles(path); + Approvals.VerifyAll("Abandoned Files:", list, f => f.Name); + } + + [TestFixture] + public class Nested + { + [Test] + public void MethodName() => + Approvals.Verify("aaa"); + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ModuleInitializer.cs b/src/ApprovalTests.NUnit3/ModuleInitializer.cs new file mode 100644 index 00000000..7f08d9bd --- /dev/null +++ b/src/ApprovalTests.NUnit3/ModuleInitializer.cs @@ -0,0 +1,6 @@ +public static class ModuleInitializer +{ + [ModuleInitializer] + public static void Initialize() => + AttributeStackTraceParser.FileInfoIsValidFilter = _ => true; +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/AssemblyLevelTest.cs b/src/ApprovalTests.NUnit3/Reporters/AssemblyLevelTest.cs new file mode 100644 index 00000000..cedfd3cf --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/AssemblyLevelTest.cs @@ -0,0 +1,12 @@ +[TestFixture] +public class AssemblyLevelTest +{ + [Test] + public void TestClassLevel() + { + using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) + { + Assert.AreEqual(typeof(DiffReporter), Approvals.GetReporter().GetType()); + } + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/CustomDiffReporter.cs b/src/ApprovalTests.NUnit3/Reporters/CustomDiffReporter.cs new file mode 100644 index 00000000..06a15c0f --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/CustomDiffReporter.cs @@ -0,0 +1,22 @@ +using ApprovalTests.Reporters.TestFrameworks; + +public class CustomDiffReporter : + FirstWorkingReporter +{ + public CustomDiffReporter() + : base( + //TODO: re-order or remove as required + BeyondCompareReporter.INSTANCE, + TortoiseDiffReporter.INSTANCE, + AraxisMergeReporter.INSTANCE, + P4MergeReporter.INSTANCE, + WinMergeReporter.INSTANCE, + KDiff3Reporter.INSTANCE, + VisualStudioReporter.INSTANCE, + RiderReporter.INSTANCE, + FrameworkAssertReporter.INSTANCE, + QuietReporter.INSTANCE + ) + { + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/FirstWorkingReporterTest.TestException.approved.txt b/src/ApprovalTests.NUnit3/Reporters/FirstWorkingReporterTest.TestException.approved.txt new file mode 100644 index 00000000..19a76f13 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/FirstWorkingReporterTest.TestException.approved.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/FirstWorkingReporterTest.cs b/src/ApprovalTests.NUnit3/Reporters/FirstWorkingReporterTest.cs new file mode 100644 index 00000000..231424f2 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/FirstWorkingReporterTest.cs @@ -0,0 +1,72 @@ +[TestFixture] +public class FirstWorkingReporterTest +{ + [Test] + public void TestCallsFirstAndOnlyFirst() + { + var a = new RecordingReporter(false); + var b = new RecordingReporter(true); + var c = new RecordingReporter(true); + + var reporter = new FirstWorkingReporter(a, b, c); + Assert.IsTrue(reporter.IsWorkingInThisEnvironment("default.txt")); + reporter.Report("a", "b"); + Assert.IsNull(a.CalledWith); + Assert.AreEqual("a,b", b.CalledWith); + Assert.IsNull(c.CalledWith); + } + + [Test] + public void TestException() + { + if (DiffEngine.BuildServerDetector.Detected) + { + // DiffReporter not detected on CI + return; + } + File.Create("received.notreal").Close(); + try + { + var ex = ExceptionUtilities.GetException(() => new DiffReporter().Report("received.notreal", "received.notreal")); + Assert.AreEqual("Could not find a diff tool for extension: .notreal", ex.Message); + } + finally + { + File.Delete("received.notreal"); + } + } + + [Test] + public void TestCleanup() + { + var cleanup1 = new MockCleanup(); + var cleanup2 = new MockCleanup(); + var r = new FirstWorkingReporter(cleanup1, new QuietReporter(), cleanup2); + r.CleanUp("a", "r"); + Assert.AreEqual("a", cleanup1.approved); + Assert.AreEqual("a", cleanup2.approved); + Assert.AreEqual("r", cleanup1.received); + Assert.AreEqual("r", cleanup2.received); + } +} + +public class MockCleanup : IEnvironmentAwareReporter, IApprovalReporterWithCleanUp +{ + public string approved; + public string received; + + public void Report(string approved, string received) + { + } + + public bool IsWorkingInThisEnvironment(string forFile) + { + return false; + } + + public void CleanUp(string approved, string received) + { + this.approved = approved; + this.received = received; + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/InlineTextReporterTest.CSharpStrings.approved.txt b/src/ApprovalTests.NUnit3/Reporters/InlineTextReporterTest.CSharpStrings.approved.txt new file mode 100644 index 00000000..de9443f2 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/InlineTextReporterTest.CSharpStrings.approved.txt @@ -0,0 +1,9 @@ +C# Strings + +var expected = "boo"; +var expected = "with \"quotes\"."; + var expected = new[]{ + "**************", + "I am ten chars", + "**************", + }; diff --git a/src/ApprovalTests.NUnit3/Reporters/InlineTextReporterTest.cs b/src/ApprovalTests.NUnit3/Reporters/InlineTextReporterTest.cs new file mode 100644 index 00000000..337db344 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/InlineTextReporterTest.cs @@ -0,0 +1,64 @@ +[TestFixture] +public class InlineTextReporterTest +{ + [Test] + public void TestComment() + { + var actual = "Hello"; + var expected = "Hello"; + Approvals.AssertText(expected, actual); + } + + [Test] + public void CSharpStrings() + { + var example1 = new[] + { + "**************", + + "I am ten chars", + "**************", + }; + var samples = new[] { "boo","with \"quotes\".", example1.JoinWith("\n"), }; + + Approvals.VerifyAll("C# Strings", samples, InlineTextReporter.ConvertToCSharp); + } + + [Test] + public void MakerHeadertest() + { + // begin-snippet: assert_text + var header = new Header(); + var actual = header.MakeHeading("I am ten chars"); + var expected = new[]{ + "**************", + "I am ten chars", + "**************", + + }; + Approvals.AssertText(expected, actual); + // end-snippet + } + + public void MakerHeaderBefore() + { + // begin-snippet: assert_text_before + var header = new Header(); + var actual = header.MakeHeading("I am ten chars"); + var expected = ""; + Approvals.AssertText(expected, actual); + // end-snippet + } +} + +public class Header +{ + public string MakeHeading(string iAmTenChars) => + new[] + { + "**************", + + "I am ten chars", + "**************", + }.JoinWith("\n"); +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/IntroductionReporterTest.TestComment.approved.txt b/src/ApprovalTests.NUnit3/Reporters/IntroductionReporterTest.TestComment.approved.txt new file mode 100644 index 00000000..17d34576 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/IntroductionReporterTest.TestComment.approved.txt @@ -0,0 +1,31 @@ +Welcome to ApprovalTests. +==== + +Please add: + +``` +[UseReporter(typeof(DiffReporter))] +``` + +to your class, test method or assembly. + +Why: +---- + +ApprovalTests uses the `[UseReporter]` attribute from your test class, method or assembly. When you do this ApprovalTest will launch the result using that reporter, for example in your diff tool. + +You can find several reporters in `ApprovalTests.Reporters` namespace, or create your own by extending the `ApprovalTests.Core.IApprovalFailureReporter` interface. + +Find more at: http://blog.approvaltests.com/2011/12/using-reporters-in-approval-tests.html + +Best Practice: +---- + +Add an *assembly* level configuration. Create a file in your base directory with the name `ApprovalTestsConfig.cs`, and the contents: + +``` +using ApprovalTests.Reporters; + +[assembly: UseReporter(typeof(DiffReporter))] +``` + diff --git a/src/ApprovalTests.NUnit3/Reporters/IntroductionReporterTest.cs b/src/ApprovalTests.NUnit3/Reporters/IntroductionReporterTest.cs new file mode 100644 index 00000000..7ad4fc37 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/IntroductionReporterTest.cs @@ -0,0 +1,7 @@ +[TestFixture] +public class IntroductionReporterTest +{ + [Test] + public void TestComment() => + Approvals.Verify(new IntroductionReporter().GetFriendlyWelcomeMessage()); +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/MultiReporterTest.cs b/src/ApprovalTests.NUnit3/Reporters/MultiReporterTest.cs new file mode 100644 index 00000000..c5f11da7 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/MultiReporterTest.cs @@ -0,0 +1,27 @@ +using ApprovalTests.Reporters.TestFrameworks; + +[TestFixture] +public class MultiReporterTest +{ + [Test] + public void TestMultiReporter() + { + var a = new RecordingReporter(); + var b = new RecordingReporter(); + var multi = new MultiReporter(a, b); + multi.Report("a", "r"); + Assert.AreEqual("a,r", a.CalledWith); + Assert.AreEqual("a,r", b.CalledWith); + } + + [Test] + public void TestCallAfterException() + { + var a = new NUnitReporter(); + var b = new RecordingReporter(); + var multi = new MultiReporter(a, b); + var exception = ExceptionUtilities.GetException(() => multi.Report("a", "r")); + Assert.AreEqual("a,r", b.CalledWith); + Assert.IsInstanceOf(exception); + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/NUnitReporterTest.TestReporter.approved.txt b/src/ApprovalTests.NUnit3/Reporters/NUnitReporterTest.TestReporter.approved.txt new file mode 100644 index 00000000..782edd32 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/NUnitReporterTest.TestReporter.approved.txt @@ -0,0 +1 @@ +World \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/NUnitReporterTest.cs b/src/ApprovalTests.NUnit3/Reporters/NUnitReporterTest.cs new file mode 100644 index 00000000..be1f1f20 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/NUnitReporterTest.cs @@ -0,0 +1,33 @@ +using ApprovalTests.Reporters.TestFrameworks; +using NUnit.Framework.Internal; + +[TestFixture] +public class NUnitReporterTest +{ + [Test] + public void TestNunitIsWorking() + { + Approvals.SetCaller(); + Assert.IsTrue(NUnitReporter.INSTANCE.IsWorkingInThisEnvironment("default.txt")); + } + + [Test] + [UseReporter(typeof(NUnitReporterWithCleanup))] + public void TestReporter() + { + try + { + using (new TestExecutionContext.IsolatedContext()) + { + Approvals.Verify("Hello"); + } + } + catch (Exception e) + { + var expectedMessage = string.Format(" String lengths are both 5. Strings differ at index 0.{0} Expected: \"World\"{0} But was: \"Hello\"{0} -----------^{0}", Environment.NewLine); + Assert.AreEqual( + expectedMessage, + e.Message); + } + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/NUnitReporterWithCleanup.cs b/src/ApprovalTests.NUnit3/Reporters/NUnitReporterWithCleanup.cs new file mode 100644 index 00000000..1d684642 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/NUnitReporterWithCleanup.cs @@ -0,0 +1,16 @@ +using ApprovalTests.Reporters.TestFrameworks; + +public class NUnitReporterWithCleanup : NUnitReporter +{ + public override void Report(string approved, string received) + { + try + { + base.Report(approved, received); + } + finally + { + File.Delete(received); + } + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/PowerShellClipboardReporterTest.TestCommand.approved.txt b/src/ApprovalTests.NUnit3/Reporters/PowerShellClipboardReporterTest.TestCommand.approved.txt new file mode 100644 index 00000000..cac24d5e --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/PowerShellClipboardReporterTest.TestCommand.approved.txt @@ -0,0 +1 @@ +Move-Item "c:\temp\recieved.txt" "c:\temp\approved.txt" -Force \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/PowerShellClipboardReporterTest.cs b/src/ApprovalTests.NUnit3/Reporters/PowerShellClipboardReporterTest.cs new file mode 100644 index 00000000..11e0c13c --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/PowerShellClipboardReporterTest.cs @@ -0,0 +1,7 @@ +[TestFixture] +public class PowerShellClipboardReporterTest +{ + [Test] + public void TestCommand() => + Approvals.Verify(PowerShellClipboardReporter.GetCommandLineForApproval(@"c:\temp\approved.txt", @"c:\temp\recieved.txt")); +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/RecordingReporter.cs b/src/ApprovalTests.NUnit3/Reporters/RecordingReporter.cs new file mode 100644 index 00000000..513cb5e5 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/RecordingReporter.cs @@ -0,0 +1,18 @@ +public class RecordingReporter : IEnvironmentAwareReporter +{ + readonly bool working; + + public RecordingReporter() => + working = true; + + public RecordingReporter(bool working) => + this.working = working; + + public void Report(string approved, string received) => + CalledWith = $"{approved},{received}"; + + public bool IsWorkingInThisEnvironment(string forFile) => + working; + + public string CalledWith { get; set; } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/ReporterFactoryTest.cs b/src/ApprovalTests.NUnit3/Reporters/ReporterFactoryTest.cs new file mode 100644 index 00000000..292fc9ed --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/ReporterFactoryTest.cs @@ -0,0 +1,89 @@ +[TestFixture] +[UseReporter(typeof(ClassLevelReporter))] +public class ReporterFactoryTest +{ + static IEnumerable GetSingletonReporterTypes() + { + var types = typeof(UseReporterAttribute).Assembly.GetTypes(); + var reporters = types.Where(r => r.GetInterfaces().Contains(typeof(IApprovalFailureReporter))); + var singletons = reporters.Where(r => r.GetConstructor(Type.EmptyTypes) != null); + return singletons; + } + + static void SubMethod() => + Assert.AreEqual(typeof(MethodLevelReporter), Approvals.GetReporter().GetType()); + + [Test] + public void TestClassLevel() + { + using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) + { + Assert.AreEqual(typeof(ClassLevelReporter), Approvals.GetReporter().GetType()); + } + } + + [Test] + [UseReporter(typeof(MethodLevelReporter))] + public void TestMethodOverride() + { + using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) + { + Assert.AreEqual(typeof(MethodLevelReporter), Approvals.GetReporter().GetType()); + } + } + + [Test] + [UseReporter(typeof(MethodLevelReporter))] + public async Task TestAsyncMethodOverride() + { + await Task.Delay(1); + using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) + { + Assert.AreEqual(typeof(MethodLevelReporter), Approvals.GetReporter().GetType()); + } + } + + [Test] + [UseReporter(typeof(MethodLevelReporter))] + public void TestMethodOverrideWithSubMethod() + { + using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) + { + SubMethod(); + } + } + + [Test] + [UseReporter(typeof(MethodLevelReporter), typeof(ClassLevelReporter))] + public void TestMultipleReporters() + { + using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) + { + Assert.AreEqual(typeof(MultiReporter), Approvals.GetReporter().GetType()); + } + } + + [Test] + public void TestSingletonOnAllReporters() + { + using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) + { + var reporters = GetSingletonReporterTypes(); + foreach (var r in reporters) Assert.IsInstanceOf(r, UseReporterAttribute.GetSingleton(r), $"Please add\npublic static readonly {r.FullName} INSTANCE = new {r.FullName}();"); + } + } +} + +public class MethodLevelReporter : IApprovalFailureReporter +{ + public void Report(string approved, string received) + { + } +} + +public class ClassLevelReporter : IApprovalFailureReporter +{ + public void Report(string approved, string received) + { + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/ReporterTest.TestInvalidReporterShouldThrow.approved.txt b/src/ApprovalTests.NUnit3/Reporters/ReporterTest.TestInvalidReporterShouldThrow.approved.txt new file mode 100644 index 00000000..9f714c4b --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/ReporterTest.TestInvalidReporterShouldThrow.approved.txt @@ -0,0 +1,9 @@ +Invalid configuration of reporter. Reporters must extend IApprovalFailureReporter. +Invalid reporter type: ReporterTest + +Note: The stack here is not helpful. + +Invalid configuration of reporter. Reporters must extend IApprovalFailureReporter. +Invalid reporter type: ReporterTest + +Note: The stack here is not helpful. \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/ReporterTest.TestMultipleWithInvalidReporterShouldThrow.approved.txt b/src/ApprovalTests.NUnit3/Reporters/ReporterTest.TestMultipleWithInvalidReporterShouldThrow.approved.txt new file mode 100644 index 00000000..a674b84b --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/ReporterTest.TestMultipleWithInvalidReporterShouldThrow.approved.txt @@ -0,0 +1,9 @@ +Invalid configuration of reporter. Reporters must extend IApprovalFailureReporter. +Invalid reporter type: System.String + +Note: The stack here is not helpful. + +Invalid configuration of reporter. Reporters must extend IApprovalFailureReporter. +Invalid reporter type: ReporterTest + +Note: The stack here is not helpful. \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/ReporterTest.cs b/src/ApprovalTests.NUnit3/Reporters/ReporterTest.cs new file mode 100644 index 00000000..8a904211 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/ReporterTest.cs @@ -0,0 +1,41 @@ +using ApprovalTests.Reporters.ContinuousIntegration; + +[TestFixture] +public class ReporterTest +{ + [Test] + public void Testname() + { + var old = Environment.GetEnvironmentVariable(NCrunchReporter.EnvironmentVariable); + Environment.SetEnvironmentVariable(NCrunchReporter.EnvironmentVariable, "1"); + Assert.IsTrue(NCrunchReporter.INSTANCE.IsWorkingInThisEnvironment("a.txt")); + Environment.SetEnvironmentVariable(NCrunchReporter.EnvironmentVariable, old); + } + + [Test] + public void TestInvalidReporterShouldThrow() + { + var attribute = new UseReporterAttribute(typeof(ReporterTest)); + VerifyReporterAttribute(attribute); + } + + [Test] + public void TestMultipleWithInvalidReporterShouldThrow() + { + var attribute = new UseReporterAttribute(typeof(ReporterTest), typeof(string)); + VerifyReporterAttribute(attribute); + } + + static void VerifyReporterAttribute(UseReporterAttribute attribute) + { + var reporter = (IEnvironmentAwareReporter) attribute.Reporter; + var reportException = Assert.Throws(() => reporter.Report("a.txt", "a.txt")); + var isWorkingException = Assert.Throws(() => reporter.IsWorkingInThisEnvironment("a.txt")); + + Approvals.Verify($""" + {reportException.Message} + + {isWorkingException.Message} + """); + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/TortoiseImageDiffTest.TestIsImage.approved.txt b/src/ApprovalTests.NUnit3/Reporters/TortoiseImageDiffTest.TestIsImage.approved.txt new file mode 100644 index 00000000..94de06af --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/TortoiseImageDiffTest.TestIsImage.approved.txt @@ -0,0 +1,9 @@ +image.png => True +image.gif => True +image.jpg => True +image.jpeg => True +image.tif => True +image.tiff => True +movie.avi => False +text.txt => False +excel.xls => False diff --git a/src/ApprovalTests.NUnit3/Reporters/TortoiseImageDiffTest.cs b/src/ApprovalTests.NUnit3/Reporters/TortoiseImageDiffTest.cs new file mode 100644 index 00000000..47901885 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Reporters/TortoiseImageDiffTest.cs @@ -0,0 +1,21 @@ +[TestFixture] +public class TortoiseImageDiffTest +{ + [Test] + public void TestIsImage() + { + if (!TortoiseTextDiffReporter.INSTANCE.IsWorkingInThisEnvironment("a.txt")) + { + return; + } + + var files = new[] + { + "image.png", "image.gif", "image.jpg", "image.jpeg", "image.tif", "image.tiff", + "movie.avi", "text.txt", "excel.xls" + }; + Approvals.VerifyAll( + files, + f => $"{f} => {TortoiseImageDiffReporter.INSTANCE.IsWorkingInThisEnvironment(f)}"); + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/RunMaintenance.cs b/src/ApprovalTests.NUnit3/RunMaintenance.cs new file mode 100644 index 00000000..77b90bd4 --- /dev/null +++ b/src/ApprovalTests.NUnit3/RunMaintenance.cs @@ -0,0 +1,14 @@ +#if(NET48) +[TestFixture] +public class RunMaintenance +{ + [Test] + public void EnsureNoAbandonedFiles() => + ApprovalMaintenance.VerifyNoAbandonedFiles( + "CustomNamerShouldBeSubstitutable.approved.txt", + "StringEncodingTest.TestUnicode.approved.txt", + "AsyncTests.TestAsyncExceptionFromVoid", + "VerifyExceptionWithStacktrace" + ); +} +#endif \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/SampleTest.TestList.approved.txt b/src/ApprovalTests.NUnit3/SampleTest.TestList.approved.txt new file mode 100644 index 00000000..de734d06 --- /dev/null +++ b/src/ApprovalTests.NUnit3/SampleTest.TestList.approved.txt @@ -0,0 +1,5 @@ +[0] = Dan +[1] = James +[2] = Jason +[3] = Katrina +[4] = Llewellyn diff --git a/src/ApprovalTests.NUnit3/SampleTest.cs b/src/ApprovalTests.NUnit3/SampleTest.cs new file mode 100644 index 00000000..c656cc8d --- /dev/null +++ b/src/ApprovalTests.NUnit3/SampleTest.cs @@ -0,0 +1,15 @@ +// begin-snippet: sample_test +[UseReporter(typeof(VisualStudioReporter))] +[TestFixture] +public class SampleTest +{ + [Test] + public void TestList() + { + var names = new[] {"Llewellyn", "James", "Dan", "Jason", "Katrina"}; + Array.Sort(names); + Approvals.VerifyAll(names, label: ""); + } +} + +// end-snippet \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Set/SetTests.TestFile.approved.txt b/src/ApprovalTests.NUnit3/Set/SetTests.TestFile.approved.txt new file mode 100644 index 00000000..7c5bd55f --- /dev/null +++ b/src/ApprovalTests.NUnit3/Set/SetTests.TestFile.approved.txt @@ -0,0 +1,3 @@ +2017-01-13 20:30:02.5369|INFO|Approvals.Class1|Test message +2017-01-13 20:30:02.5599|INFO|Approvals.Class1|A third line +2017-01-13 20:30:02.5599|INFO|Approvals.Class1|Another line diff --git a/src/ApprovalTests.NUnit3/Set/SetTests.TestFileWithScrubber.approved.txt b/src/ApprovalTests.NUnit3/Set/SetTests.TestFileWithScrubber.approved.txt new file mode 100644 index 00000000..72529dd0 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Set/SetTests.TestFileWithScrubber.approved.txt @@ -0,0 +1,3 @@ +|INFO|Approvals.Class1|A third line +|INFO|Approvals.Class1|Another line +|INFO|Approvals.Class1|Test message diff --git a/src/ApprovalTests.NUnit3/Set/SetTests.TestListObject.approved.txt b/src/ApprovalTests.NUnit3/Set/SetTests.TestListObject.approved.txt new file mode 100644 index 00000000..19697491 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Set/SetTests.TestListObject.approved.txt @@ -0,0 +1,3 @@ +[0] = apple +[1] = banana +[2] = carrot diff --git a/src/ApprovalTests.NUnit3/Set/SetTests.TestListString.approved.txt b/src/ApprovalTests.NUnit3/Set/SetTests.TestListString.approved.txt new file mode 100644 index 00000000..19697491 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Set/SetTests.TestListString.approved.txt @@ -0,0 +1,3 @@ +[0] = apple +[1] = banana +[2] = carrot diff --git a/src/ApprovalTests.NUnit3/Set/SetTests.cs b/src/ApprovalTests.NUnit3/Set/SetTests.cs new file mode 100644 index 00000000..23032b6f --- /dev/null +++ b/src/ApprovalTests.NUnit3/Set/SetTests.cs @@ -0,0 +1,53 @@ +using ApprovalTests.Set; +using System.Text.RegularExpressions; + +[TestFixture] +public class SetTests +{ + [Test] + public void TestListString() + { + // Approved file has order apple, banana, carrot + var list = new List { "carrot", "apple", "banana" }; + SetApprovals.VerifySet(list, string.Empty); + } + + public class Foo: IComparable + { + public string Bar { get; set; } + + public int CompareTo(Foo other) + { + return Bar.CompareTo(other.Bar); + } + } + + [Test] + public void TestListObject() + { + var list = new List + { + new() { Bar = "carrot" }, + new() { Bar = "apple" }, + new() { Bar = "banana" }, + }; + SetApprovals.VerifySet(list, string.Empty, f => f.Bar); + } + + [Test] + public void TestFile() + { + var path = PathUtilities.GetDirectoryForCaller(); + var file = path + "a.txt"; + SetApprovals.VerifyFileAsSet(file); + } + + [Test] + public void TestFileWithScrubber() + { + var path = PathUtilities.GetDirectoryForCaller(); + var file = path + "a.txt"; + Func scrubber = s => Regex.Replace(s, @"^[^\|]*", ""); + SetApprovals.VerifyFileAsSet(file, scrubber); + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Set/a.txt b/src/ApprovalTests.NUnit3/Set/a.txt new file mode 100644 index 00000000..73b40084 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Set/a.txt @@ -0,0 +1,3 @@ +2017-01-13 20:30:02.5369|INFO|Approvals.Class1|Test message +2017-01-13 20:30:02.5599|INFO|Approvals.Class1|Another line +2017-01-13 20:30:02.5599|INFO|Approvals.Class1|A third line diff --git a/src/ApprovalTests.NUnit3/StackTraceScrubberTest.cs b/src/ApprovalTests.NUnit3/StackTraceScrubberTest.cs new file mode 100644 index 00000000..28f89707 --- /dev/null +++ b/src/ApprovalTests.NUnit3/StackTraceScrubberTest.cs @@ -0,0 +1,24 @@ +[TestFixture] +public class StackTraceScrubberTest +{ + [Test] + public void TestDashedPath() + { + const string Path = @"C:\code\ApprovalTests - Net\Persistence\Datasets\DatasetTest.cs"; + Assert.AreEqual("...\\DatasetTest.cs", StackTraceScrubber.ScrubPaths(Path)); + } + + [Test] + public void TestDashedPathOnMac() + { + const string Path = "/Users/approver/code/ApprovalTests - Net/Persistence/Datasets/DatasetTest.cs"; + Assert.AreEqual(".../DatasetTest.cs", StackTraceScrubber.ScrubPaths(Path)); + } + + [Test] + public void TestKeyValuePair() + { + const string Value = "name: File.foo"; + Assert.AreEqual(Value, StackTraceScrubber.ScrubPaths(Value)); + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/StringEncodingTest.TestAscii.approved.txt b/src/ApprovalTests.NUnit3/StringEncodingTest.TestAscii.approved.txt new file mode 100644 index 00000000..a259b282 --- /dev/null +++ b/src/ApprovalTests.NUnit3/StringEncodingTest.TestAscii.approved.txt @@ -0,0 +1 @@ +ascii \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/StringEncodingTest.TestUnicode.approved.txt b/src/ApprovalTests.NUnit3/StringEncodingTest.TestUnicode.approved.txt new file mode 100644 index 00000000..99e64747 --- /dev/null +++ b/src/ApprovalTests.NUnit3/StringEncodingTest.TestUnicode.approved.txt @@ -0,0 +1 @@ +eënt \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/StringEncodingTest.TestUtf8.approved.txt b/src/ApprovalTests.NUnit3/StringEncodingTest.TestUtf8.approved.txt new file mode 100644 index 00000000..00860fa0 --- /dev/null +++ b/src/ApprovalTests.NUnit3/StringEncodingTest.TestUtf8.approved.txt @@ -0,0 +1 @@ +UƬf8 \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/StringEncodingTest.cs b/src/ApprovalTests.NUnit3/StringEncodingTest.cs new file mode 100644 index 00000000..a50a2cae --- /dev/null +++ b/src/ApprovalTests.NUnit3/StringEncodingTest.cs @@ -0,0 +1,27 @@ +[TestFixture] +[UseReporter(typeof(ClipboardReporter))] +public class StringEncodingTest +{ + [Test] + public void TestUtf8() + { + var text = "UƬf8"; + Approvals.Verify(text); + } + + [Test] + public void TestAscii() + { + var text = "ascii"; + Approvals.Verify(text); + } + +#if(NETFRAMEWORK) + [Test] + public void TestUnicode() + { + var text = System.Text.Encoding.Default.GetString([101, 235, 110, 116]); + Approvals.Verify(text); + } +#endif +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/UnixLineEndings.txt b/src/ApprovalTests.NUnit3/UnixLineEndings.txt new file mode 100644 index 00000000..bab18e64 --- /dev/null +++ b/src/ApprovalTests.NUnit3/UnixLineEndings.txt @@ -0,0 +1,2 @@ +Foo +Bar \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/WindowsLineEndings.txt b/src/ApprovalTests.NUnit3/WindowsLineEndings.txt new file mode 100644 index 00000000..bab18e64 --- /dev/null +++ b/src/ApprovalTests.NUnit3/WindowsLineEndings.txt @@ -0,0 +1,2 @@ +Foo +Bar \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Writers/ExistingFileTest.TestExistFileIsApproved.approved.png b/src/ApprovalTests.NUnit3/Writers/ExistingFileTest.TestExistFileIsApproved.approved.png new file mode 100644 index 0000000000000000000000000000000000000000..82d622f253d714d9c86c3470ec7de961b6ac750b GIT binary patch literal 417 zcmV;S0bc%zP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUzA4x<(RA@u(Sj!HAKn%qH|1pmq{2vA4np*l=6Ua0f5-v-@GLO#6 z?fJOB79KbVY=rQ{!C>i5#wu-7P~JNF`?e%Rg54E(PZ%TwY-Aq@*%UXWu2G z`{kNciT7MfNwU9jpVhPeee`j)Z?K{!<;z;&>2YDzS86^xy*&%O`iwkHbfp(Wf+cB7RMQHFFS;wvamc@@=G)E_DSU+`uLv7CqKj>E{R06a@nHiBlaYjCrkyY0xz zBWpJ7wexi7df`3*_v*c@h}N@bA-Scr?X~83r!jy8c-9LELH{3;G05xZe)lRlge06x z!cX23?CZd;U`>ZGL$DNCQSFsAbO;?nheVE}L+B7Xgbo37K}5(KMK}zxR&(WriterFactory.CreateTextWriter("foo")); + WriterFactory.SetTextWriterCreator(t => new MyTextWriter(t)); + Assert.IsInstanceOf(WriterFactory.CreateTextWriter("foo")); + } + + [Test] + public void TestTextWriterWithExtension() + { + Assert.IsInstanceOf(WriterFactory.CreateTextWriter("foo", ".txt")); + WriterFactory.SetTextWriterCreator((t, e) => new MyTextWriter(t, e)); + Assert.IsInstanceOf(WriterFactory.CreateTextWriter("foo", "txt")); + } +} + +public class MyTextWriter : ApprovalTextWriter +{ + public MyTextWriter(string data) + : base(data) + { + } + + public MyTextWriter(string data, string extensionWithoutDot) + : base(data, extensionWithoutDot) + { + } +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Xml/XmlTest.TestOrderedXmlWithAttributes.approved.xml b/src/ApprovalTests.NUnit3/Xml/XmlTest.TestOrderedXmlWithAttributes.approved.xml new file mode 100644 index 00000000..08047817 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Xml/XmlTest.TestOrderedXmlWithAttributes.approved.xml @@ -0,0 +1,4 @@ + + + hi + \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Xml/XmlTest.TestOrderedXmlWithDeepAttributes.approved.xml b/src/ApprovalTests.NUnit3/Xml/XmlTest.TestOrderedXmlWithDeepAttributes.approved.xml new file mode 100644 index 00000000..a8f179f3 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Xml/XmlTest.TestOrderedXmlWithDeepAttributes.approved.xml @@ -0,0 +1,4 @@ + + + hi + \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Xml/XmlTest.TestXml.approved.xml b/src/ApprovalTests.NUnit3/Xml/XmlTest.TestXml.approved.xml new file mode 100644 index 00000000..f14ebf84 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Xml/XmlTest.TestXml.approved.xml @@ -0,0 +1,4 @@ + + + hi + \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Xml/XmlTest.cs b/src/ApprovalTests.NUnit3/Xml/XmlTest.cs new file mode 100644 index 00000000..f53b2bc1 --- /dev/null +++ b/src/ApprovalTests.NUnit3/Xml/XmlTest.cs @@ -0,0 +1,17 @@ +using ApprovalTests.Xml; + +[TestFixture] +public class XmlTest +{ + [Test] + public void TestXml() => + XmlApprovals.VerifyXml("hi"); + + [Test] + public void TestOrderedXmlWithAttributes() => + XmlApprovals.VerifyOrderedXml("hi"); + + [Test] + public void TestOrderedXmlWithDeepAttributes() => + XmlApprovals.VerifyOrderedXml("hi"); +} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/a.png b/src/ApprovalTests.NUnit3/a.png new file mode 100644 index 0000000000000000000000000000000000000000..82d622f253d714d9c86c3470ec7de961b6ac750b GIT binary patch literal 417 zcmV;S0bc%zP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUzA4x<(RA@u(Sj!HAKn%qH|1pmq{2vA4np*l=6Ua0f5-v-@GLO#6 z?fJOB79KbVY=rQ{!C>i5#wu-7P~JNF`?e%Rg54E(PZ%TwY-Aq@*%UXWu2G z`{kNciT7MfNwU9jpVhPeee`j)Z?K{!<;z;&>2YDzS86^xy*&%O`iwkHbfp(Wf+cB7RMQHFFS;wvamc@@=G)E_DSU+`uLv7CqKj>E{R06a@nHiBlaYjCrkyY0xz zBWpJ7wexi7df`3*_v*c@h}N@bA-Scr?X~83r!jy8c-9LELH{3;G05xZe)lRlge06x z!cX23?CZd;U`>ZGL$DNCQSFsAbO;?nheVE}L+B7Xgbo37K}5(KMK}zxR&LI78Ds+1Y|7P->{$f;d1$WF1a5rcb~hf zONfg`ID0t*01z?ws3ZU!Q2*L7n2jkdZz{4mhr*=jNH8$(t+WA0aztzd07EReISXpT zr%CvvSOCi21AuW0fCC%F*aDy^5CBys0AcL_cv9K?L@WRZ6Yu<@y2uZbJD+lMcaJ=BT^$q_NPCm7s83&b+Z)rAVNO1v zCM|w%+&lPF)YKw6G+Ww~vq-Yw6cyHFcA;6PS!6NChK*(C;`vA%0navE3}EQDL|Ki) z!OeV(NBnOHw!bvaik8oOIlZlkvp|0Z~fxy}=rNR>a9`G^lbTp`!a$R0h0CZA7%b0^A% z4z!&Gf6>}@c{}J;+HH}Qg!NmN%iN;151#5%`J&^EkB9EUl5_<_u-0n*f4Ra45LS)1 zjwQ!#@{te<5=rj&Y^r!&)1^RG5a~ac8x18drqwOluCG5*V_dPWR%7>+*A`YbG$_&b zbe~<8EnTiP>^==s^xd2pV z_ZujyymxjnD;C_&?2hi+#T-%y&MG+K!3}QC0fg+ihq+mw5$xDr4|_k@=fSQAc0IK3 z1N%PwzwZGgBji;9`l#0vK~N~Qq5{|1XhpLjh%bAd2&BFr9Q)4Fef62`w*WC8$3+c9 HW-|W)A|0Di literal 0 HcmV?d00001 diff --git a/src/ApprovalTests.NUnit3/b.txt b/src/ApprovalTests.NUnit3/b.txt new file mode 100644 index 00000000..36c6edb4 --- /dev/null +++ b/src/ApprovalTests.NUnit3/b.txt @@ -0,0 +1 @@ +text b \ No newline at end of file diff --git a/src/ApprovalTests.sln b/src/ApprovalTests.sln index e6f88391..b9a33f59 100644 --- a/src/ApprovalTests.sln +++ b/src/ApprovalTests.sln @@ -22,6 +22,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApprovalUtilities", "Approv EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApprovalTests.Xunit2", "ApprovalTests.Xunit2\ApprovalTests.Xunit2.csproj", "{E9BD0B96-01C4-4B25-ADFD-3A630970D267}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApprovalTests.NUnit3", "ApprovalTests.NUnit3\ApprovalTests.NUnit3.csproj", "{33F31A8B-82DC-4450-9F67-8C707364E894}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -52,6 +54,10 @@ Global {E9BD0B96-01C4-4B25-ADFD-3A630970D267}.Debug|Any CPU.Build.0 = Debug|Any CPU {E9BD0B96-01C4-4B25-ADFD-3A630970D267}.Release|Any CPU.ActiveCfg = Release|Any CPU {E9BD0B96-01C4-4B25-ADFD-3A630970D267}.Release|Any CPU.Build.0 = Release|Any CPU + {33F31A8B-82DC-4450-9F67-8C707364E894}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {33F31A8B-82DC-4450-9F67-8C707364E894}.Debug|Any CPU.Build.0 = Debug|Any CPU + {33F31A8B-82DC-4450-9F67-8C707364E894}.Release|Any CPU.ActiveCfg = Release|Any CPU + {33F31A8B-82DC-4450-9F67-8C707364E894}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From fc766674e181f4ced4b847c829c18d252717765d Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 11 May 2024 17:16:48 +1000 Subject: [PATCH 02/12] . --- .../Async/AsyncTests.TestAsync.approved.txt | 1 - src/ApprovalTests.NUnit3/Async/AsyncTests.cs | 17 - .../CombinationApprovalsTests.cs | 12 - ...ntApprovalsTest.MulticastPoco.approved.txt | 6 - ...ventApprovalsTest.UnicastPoco.approved.txt | 8 - .../Events/EventApprovalsTest.cs | 21 - .../Events/TestingEventPoco.cs | 20 - .../Events/TestingListener.cs | 12 - ...t.TestExecutableFailure.Inner.approved.txt | 1 - ...bleTest.TestExecutableFailure.approved.txt | 1 - ...ureWithPreviousApproval.Inner.approved.txt | 1 - ...leFailureWithPreviousApproval.approved.txt | 2 - ...t.TestExecutableSuccess.Inner.approved.txt | 1 - ...bleTest.TestExecutableSuccess.approved.txt | 1 - .../Executable/ExecutableTest.cs | 47 -- ...tomNamerShouldBeSubstitutable.approved.txt | 1 - .../CustomNamerShouldBeSubstitutableTest.cs | 43 -- ...kDownTests.TestExceptions.Mac.approved.txt | 4 - ...icrosoft_Windows_10_Education.approved.txt | 4 - ...crosoft_Windows_10_Enterprise.approved.txt | 4 - ...s.Microsoft_Windows_10_Home_N.approved.txt | 4 - ...ions.Microsoft_Windows_10_Pro.approved.txt | 4 - ...crosoft_Windows_11_Enterprise.approved.txt | 4 - ...ions.Microsoft_Windows_11_Pro.approved.txt | 4 - ...indows_Server_2016_Datacenter.approved.txt | 4 - ...indows_Server_2019_Datacenter.approved.txt | 4 - ...ests.TestExceptions.Windows_7.approved.txt | 4 - ...ests.TestExceptions.Windows_8.approved.txt | 4 - .../LockDownTests.TestLockDown.approved.txt | 512 ------------------ .../LockDownTests.TestLockDown2.approved.txt | 4 - .../LockDownTests.TestLockDown8.approved.txt | 256 --------- src/ApprovalTests.NUnit3/LockDownTests.cs | 39 -- ...st.FindAbandonedApprovalFiles.approved.txt | 3 - ...tenanceTest.Nested.MethodName.approved.txt | 1 - .../Maintenance/ApprovalMaintenanceTest.cs | 21 - .../Set/SetTests.TestFile.approved.txt | 3 - ...SetTests.TestFileWithScrubber.approved.txt | 3 - .../Set/SetTests.TestListObject.approved.txt | 3 - .../Set/SetTests.TestListString.approved.txt | 3 - src/ApprovalTests.NUnit3/Set/SetTests.cs | 53 -- src/ApprovalTests.NUnit3/Set/a.txt | 3 - ...eTest.TestExistFileIsApproved.approved.png | Bin 417 -> 0 bytes .../Writers/ExistingFileTest.cs | 17 - .../Writers/WriterFactoryTests.cs | 34 -- ....TestOrderedXmlWithAttributes.approved.xml | 4 - ...tOrderedXmlWithDeepAttributes.approved.xml | 4 - .../Xml/XmlTest.TestXml.approved.xml | 4 - src/ApprovalTests.NUnit3/Xml/XmlTest.cs | 17 - 48 files changed, 1223 deletions(-) delete mode 100644 src/ApprovalTests.NUnit3/Async/AsyncTests.TestAsync.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Async/AsyncTests.cs delete mode 100644 src/ApprovalTests.NUnit3/CombinationApprovalsTests.cs delete mode 100644 src/ApprovalTests.NUnit3/Events/EventApprovalsTest.MulticastPoco.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Events/EventApprovalsTest.UnicastPoco.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Events/EventApprovalsTest.cs delete mode 100644 src/ApprovalTests.NUnit3/Events/TestingEventPoco.cs delete mode 100644 src/ApprovalTests.NUnit3/Events/TestingListener.cs delete mode 100644 src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailure.Inner.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailure.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailureWithPreviousApproval.Inner.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailureWithPreviousApproval.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableSuccess.Inner.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableSuccess.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Executable/ExecutableTest.cs delete mode 100644 src/ApprovalTests.NUnit3/Issues/CustomNamerShouldBeSubstitutableTest.CustomNamerShouldBeSubstitutable.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Issues/CustomNamerShouldBeSubstitutableTest.cs delete mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Mac.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Education.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Enterprise.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Home_N.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Pro.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_11_Enterprise.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_11_Pro.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_Server_2016_Datacenter.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_Server_2019_Datacenter.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Windows_7.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Windows_8.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestLockDown.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestLockDown2.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/LockDownTests.TestLockDown8.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/LockDownTests.cs delete mode 100644 src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.FindAbandonedApprovalFiles.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.Nested.MethodName.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.cs delete mode 100644 src/ApprovalTests.NUnit3/Set/SetTests.TestFile.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Set/SetTests.TestFileWithScrubber.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Set/SetTests.TestListObject.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Set/SetTests.TestListString.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Set/SetTests.cs delete mode 100644 src/ApprovalTests.NUnit3/Set/a.txt delete mode 100644 src/ApprovalTests.NUnit3/Writers/ExistingFileTest.TestExistFileIsApproved.approved.png delete mode 100644 src/ApprovalTests.NUnit3/Writers/ExistingFileTest.cs delete mode 100644 src/ApprovalTests.NUnit3/Writers/WriterFactoryTests.cs delete mode 100644 src/ApprovalTests.NUnit3/Xml/XmlTest.TestOrderedXmlWithAttributes.approved.xml delete mode 100644 src/ApprovalTests.NUnit3/Xml/XmlTest.TestOrderedXmlWithDeepAttributes.approved.xml delete mode 100644 src/ApprovalTests.NUnit3/Xml/XmlTest.TestXml.approved.xml delete mode 100644 src/ApprovalTests.NUnit3/Xml/XmlTest.cs diff --git a/src/ApprovalTests.NUnit3/Async/AsyncTests.TestAsync.approved.txt b/src/ApprovalTests.NUnit3/Async/AsyncTests.TestAsync.approved.txt deleted file mode 100644 index 28fcd99e..00000000 --- a/src/ApprovalTests.NUnit3/Async/AsyncTests.TestAsync.approved.txt +++ /dev/null @@ -1 +0,0 @@ -This came asynchronously \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Async/AsyncTests.cs b/src/ApprovalTests.NUnit3/Async/AsyncTests.cs deleted file mode 100644 index b66a9814..00000000 --- a/src/ApprovalTests.NUnit3/Async/AsyncTests.cs +++ /dev/null @@ -1,17 +0,0 @@ -[TestFixture] -[UseReporter(typeof(MachineSpecificReporter))] -public class AsyncTests -{ - [Test] - public async Task TestAsync() - { - var text = await AsyncMethod(); - Approvals.Verify(text); - } - - static async Task AsyncMethod() - { - await Task.Delay(1); - return "This came asynchronously"; - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/CombinationApprovalsTests.cs b/src/ApprovalTests.NUnit3/CombinationApprovalsTests.cs deleted file mode 100644 index a8438343..00000000 --- a/src/ApprovalTests.NUnit3/CombinationApprovalsTests.cs +++ /dev/null @@ -1,12 +0,0 @@ -public class CombinationApprovalsTests -{ - [Test] - [SetCulture("es-ES")] - public void ArgsShouldBeReportedInInvariantCulture() - { - var dateTime = new DateTime(2000, 5, 22, 13, 43, 21); - var result = CombinationApprovals.GetApprovalString(_ => "test", Enumerable.Repeat(dateTime, 1)); - var invariantDate = dateTime.ToString(CultureInfo.InvariantCulture); - StringAssert.Contains(invariantDate, result); - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Events/EventApprovalsTest.MulticastPoco.approved.txt b/src/ApprovalTests.NUnit3/Events/EventApprovalsTest.MulticastPoco.approved.txt deleted file mode 100644 index 484b0436..00000000 --- a/src/ApprovalTests.NUnit3/Events/EventApprovalsTest.MulticastPoco.approved.txt +++ /dev/null @@ -1,6 +0,0 @@ -Event Configuration for TestingEventPoco - -MyEvent: - [0] Void AnotherStandardCallback(System.Object, System.EventArgs) - [1] Void StandardCallback(System.Object, System.EventArgs) - diff --git a/src/ApprovalTests.NUnit3/Events/EventApprovalsTest.UnicastPoco.approved.txt b/src/ApprovalTests.NUnit3/Events/EventApprovalsTest.UnicastPoco.approved.txt deleted file mode 100644 index 92e5a793..00000000 --- a/src/ApprovalTests.NUnit3/Events/EventApprovalsTest.UnicastPoco.approved.txt +++ /dev/null @@ -1,8 +0,0 @@ -Event Configuration for TestingEventPoco - -MyEvent: - [0] Void StandardCallback(System.Object, System.EventArgs) - -PropertyChanged: - [0] Void PropertyChangedCallback(System.Object, System.ComponentModel.PropertyChangedEventArgs) - diff --git a/src/ApprovalTests.NUnit3/Events/EventApprovalsTest.cs b/src/ApprovalTests.NUnit3/Events/EventApprovalsTest.cs deleted file mode 100644 index 95614477..00000000 --- a/src/ApprovalTests.NUnit3/Events/EventApprovalsTest.cs +++ /dev/null @@ -1,21 +0,0 @@ -[TestFixture] -public class EventApprovalsTest -{ - [Test] - public void MulticastPoco() - { - var testingPoco = new TestingEventPoco(); - testingPoco.MyEvent += TestingListener.AnotherStandardCallback; - testingPoco.MyEvent += TestingListener.StandardCallback; - EventApprovals.VerifyEvents(testingPoco); - } - - [Test] - public void UnicastPoco() - { - var testingPoco = new TestingEventPoco(); - testingPoco.MyEvent += TestingListener.StandardCallback; - testingPoco.PropertyChanged += TestingListener.PropertyChangedCallback; - EventApprovals.VerifyEvents(testingPoco); - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Events/TestingEventPoco.cs b/src/ApprovalTests.NUnit3/Events/TestingEventPoco.cs deleted file mode 100644 index 05420e50..00000000 --- a/src/ApprovalTests.NUnit3/Events/TestingEventPoco.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.ComponentModel; - -public class TestingEventPoco : INotifyPropertyChanged -{ - readonly object NonEventField = new(); - - public event EventHandler MyEvent; - -#pragma warning disable 67 - - public event PropertyChangedEventHandler PropertyChanged; - -#pragma warning restore 67 - - protected virtual void OnMyEvent(object sender, EventArgs e) - { - var handler = MyEvent; - handler?.Invoke(sender, e); - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Events/TestingListener.cs b/src/ApprovalTests.NUnit3/Events/TestingListener.cs deleted file mode 100644 index cc0c9c7b..00000000 --- a/src/ApprovalTests.NUnit3/Events/TestingListener.cs +++ /dev/null @@ -1,12 +0,0 @@ -public static class TestingListener -{ - public static void AnotherStandardCallback(object sender, EventArgs e) => - throw new NotImplementedException(); - - public static void PropertyChangedCallback(object sender, System.ComponentModel.PropertyChangedEventArgs e) - { - } - - public static void StandardCallback(object sender, EventArgs e) => - throw new NotImplementedException(); -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailure.Inner.approved.txt b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailure.Inner.approved.txt deleted file mode 100644 index 5f282702..00000000 --- a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailure.Inner.approved.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailure.approved.txt b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailure.approved.txt deleted file mode 100644 index 51e25404..00000000 --- a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailure.approved.txt +++ /dev/null @@ -1 +0,0 @@ -Increased feedback on[0] = Sam diff --git a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailureWithPreviousApproval.Inner.approved.txt b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailureWithPreviousApproval.Inner.approved.txt deleted file mode 100644 index 74c82f0d..00000000 --- a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailureWithPreviousApproval.Inner.approved.txt +++ /dev/null @@ -1 +0,0 @@ -I am diff --git a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailureWithPreviousApproval.approved.txt b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailureWithPreviousApproval.approved.txt deleted file mode 100644 index ee925b50..00000000 --- a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableFailureWithPreviousApproval.approved.txt +++ /dev/null @@ -1,2 +0,0 @@ -Increased feedback on[0] = Sam -Increased feedback on[1] = I am diff --git a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableSuccess.Inner.approved.txt b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableSuccess.Inner.approved.txt deleted file mode 100644 index 3ac8656d..00000000 --- a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableSuccess.Inner.approved.txt +++ /dev/null @@ -1 +0,0 @@ -Sam \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableSuccess.approved.txt b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableSuccess.approved.txt deleted file mode 100644 index f16c5fdd..00000000 --- a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.TestExecutableSuccess.approved.txt +++ /dev/null @@ -1 +0,0 @@ -Increased feedback on is empty \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.cs b/src/ApprovalTests.NUnit3/Executable/ExecutableTest.cs deleted file mode 100644 index 35c90b92..00000000 --- a/src/ApprovalTests.NUnit3/Executable/ExecutableTest.cs +++ /dev/null @@ -1,47 +0,0 @@ -[TestFixture] -[UseReporter(typeof(QuietReporter))] -public class ExecutableTest -{ - static List RunExecutableApproval() - { - var output = new List(); - - try - { - NamerFactory.AdditionalInformation = "Inner"; - Approvals.VerifyWithCallback("Sam", s => output.Add(s)); - } - catch (Exception) - { - } - - return output; - } - - [Test] - public void TestExecutableFailure() - { - using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) - { - Approvals.VerifyAll(RunExecutableApproval(), "Increased feedback on"); - } - } - - [Test] - public void TestExecutableFailureWithPreviousApproval() - { - using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) - { - Approvals.VerifyAll(RunExecutableApproval(), "Increased feedback on"); - } - } - - [Test] - public void TestExecutableSuccess() - { - using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) - { - Approvals.VerifyAll(RunExecutableApproval(), "Increased feedback on"); - } - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Issues/CustomNamerShouldBeSubstitutableTest.CustomNamerShouldBeSubstitutable.approved.txt b/src/ApprovalTests.NUnit3/Issues/CustomNamerShouldBeSubstitutableTest.CustomNamerShouldBeSubstitutable.approved.txt deleted file mode 100644 index e3b8c23e..00000000 --- a/src/ApprovalTests.NUnit3/Issues/CustomNamerShouldBeSubstitutableTest.CustomNamerShouldBeSubstitutable.approved.txt +++ /dev/null @@ -1 +0,0 @@ -CustomNamerShouldBeSubstitutable \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Issues/CustomNamerShouldBeSubstitutableTest.cs b/src/ApprovalTests.NUnit3/Issues/CustomNamerShouldBeSubstitutableTest.cs deleted file mode 100644 index 09331db5..00000000 --- a/src/ApprovalTests.NUnit3/Issues/CustomNamerShouldBeSubstitutableTest.cs +++ /dev/null @@ -1,43 +0,0 @@ -using ApprovalTests.Writers; -using ApprovalUtilities.CallStack; - -[TestFixture] -public class CustomNamerShouldBeSubstitutableTest -{ - /// - /// Test for Issue #140 - /// https://github.com/approvals/ApprovalTests.Net/issues/140 - /// - [Test] - public void CustomNamerShouldNotDependOnSetCallerTest() - { - var approvalText = "CustomNamerShouldBeSubstitutable"; - - var writer = WriterFactory.CreateTextWriter(approvalText); - var namer = new CustomNamer(); - var reporter = new MethodLevelReporter(); - - Approvals.Verify(writer, namer, reporter); - } - - [Test] - public void CustomNamerShouldBeSubstitutable() - { - // just here to prevent false detection as abandoned file via Maintenance test - } - - class CustomNamer : IApprovalNamer - { - public string Name => "CustomNamerShouldBeSubstitutableTest.CustomNamerShouldBeSubstitutable"; - - public string SourcePath - { - get - { - var stackTraceParser = new StackTraceParser(); - stackTraceParser.Parse(new Caller().StackTrace); - return stackTraceParser.SourcePath; - } - } - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Mac.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Mac.approved.txt deleted file mode 100644 index 92cea9fb..00000000 --- a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Mac.approved.txt +++ /dev/null @@ -1,4 +0,0 @@ -[0,0] => Division by zero -[0,2] => 0 -[2,0] => Division by zero -[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Education.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Education.approved.txt deleted file mode 100644 index 2b752a46..00000000 --- a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Education.approved.txt +++ /dev/null @@ -1,4 +0,0 @@ -[0,0] => Attempted to divide by zero. -[0,2] => 0 -[2,0] => Attempted to divide by zero. -[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Enterprise.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Enterprise.approved.txt deleted file mode 100644 index 2b752a46..00000000 --- a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Enterprise.approved.txt +++ /dev/null @@ -1,4 +0,0 @@ -[0,0] => Attempted to divide by zero. -[0,2] => 0 -[2,0] => Attempted to divide by zero. -[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Home_N.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Home_N.approved.txt deleted file mode 100644 index 2b752a46..00000000 --- a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Home_N.approved.txt +++ /dev/null @@ -1,4 +0,0 @@ -[0,0] => Attempted to divide by zero. -[0,2] => 0 -[2,0] => Attempted to divide by zero. -[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Pro.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Pro.approved.txt deleted file mode 100644 index 2b752a46..00000000 --- a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_10_Pro.approved.txt +++ /dev/null @@ -1,4 +0,0 @@ -[0,0] => Attempted to divide by zero. -[0,2] => 0 -[2,0] => Attempted to divide by zero. -[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_11_Enterprise.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_11_Enterprise.approved.txt deleted file mode 100644 index 2b752a46..00000000 --- a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_11_Enterprise.approved.txt +++ /dev/null @@ -1,4 +0,0 @@ -[0,0] => Attempted to divide by zero. -[0,2] => 0 -[2,0] => Attempted to divide by zero. -[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_11_Pro.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_11_Pro.approved.txt deleted file mode 100644 index 2b752a46..00000000 --- a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_11_Pro.approved.txt +++ /dev/null @@ -1,4 +0,0 @@ -[0,0] => Attempted to divide by zero. -[0,2] => 0 -[2,0] => Attempted to divide by zero. -[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_Server_2016_Datacenter.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_Server_2016_Datacenter.approved.txt deleted file mode 100644 index 2b752a46..00000000 --- a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_Server_2016_Datacenter.approved.txt +++ /dev/null @@ -1,4 +0,0 @@ -[0,0] => Attempted to divide by zero. -[0,2] => 0 -[2,0] => Attempted to divide by zero. -[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_Server_2019_Datacenter.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_Server_2019_Datacenter.approved.txt deleted file mode 100644 index 2b752a46..00000000 --- a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Microsoft_Windows_Server_2019_Datacenter.approved.txt +++ /dev/null @@ -1,4 +0,0 @@ -[0,0] => Attempted to divide by zero. -[0,2] => 0 -[2,0] => Attempted to divide by zero. -[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Windows_7.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Windows_7.approved.txt deleted file mode 100644 index 2b752a46..00000000 --- a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Windows_7.approved.txt +++ /dev/null @@ -1,4 +0,0 @@ -[0,0] => Attempted to divide by zero. -[0,2] => 0 -[2,0] => Attempted to divide by zero. -[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Windows_8.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Windows_8.approved.txt deleted file mode 100644 index 2b752a46..00000000 --- a/src/ApprovalTests.NUnit3/LockDownTests.TestExceptions.Windows_8.approved.txt +++ /dev/null @@ -1,4 +0,0 @@ -[0,0] => Attempted to divide by zero. -[0,2] => 0 -[2,0] => Attempted to divide by zero. -[2,2] => 1 diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestLockDown.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestLockDown.approved.txt deleted file mode 100644 index 531362be..00000000 --- a/src/ApprovalTests.NUnit3/LockDownTests.TestLockDown.approved.txt +++ /dev/null @@ -1,512 +0,0 @@ -[1,1,1,1,1,1,1,1,1] => [1, 1, 1, 1, 1, 1, 1, 1, 1] -[1,1,1,1,1,1,1,1,2] => [1, 1, 1, 1, 1, 1, 1, 1, 2] -[1,1,1,1,1,1,1,2,1] => [1, 1, 1, 1, 1, 1, 1, 2, 1] -[1,1,1,1,1,1,1,2,2] => [1, 1, 1, 1, 1, 1, 1, 2, 2] -[1,1,1,1,1,1,2,1,1] => [1, 1, 1, 1, 1, 1, 2, 1, 1] -[1,1,1,1,1,1,2,1,2] => [1, 1, 1, 1, 1, 1, 2, 1, 2] -[1,1,1,1,1,1,2,2,1] => [1, 1, 1, 1, 1, 1, 2, 2, 1] -[1,1,1,1,1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1, 2] -[2,2,2,2,2,1,1,2,1] => [2, 2, 2, 2, 2, 1, 1, 2, 1] -[2,2,2,2,2,1,1,2,2] => [2, 2, 2, 2, 2, 1, 1, 2, 2] -[2,2,2,2,2,1,2,1,1] => [2, 2, 2, 2, 2, 1, 2, 1, 1] -[2,2,2,2,2,1,2,1,2] => [2, 2, 2, 2, 2, 1, 2, 1, 2] -[2,2,2,2,2,1,2,2,1] => [2, 2, 2, 2, 2, 1, 2, 2, 1] -[2,2,2,2,2,1,2,2,2] => [2, 2, 2, 2, 2, 1, 2, 2, 2] -[2,2,2,2,2,2,1,1,1] => [2, 2, 2, 2, 2, 2, 1, 1, 1] -[2,2,2,2,2,2,1,1,2] => [2, 2, 2, 2, 2, 2, 1, 1, 2] -[2,2,2,2,2,2,1,2,1] => [2, 2, 2, 2, 2, 2, 1, 2, 1] -[2,2,2,2,2,2,1,2,2] => [2, 2, 2, 2, 2, 2, 1, 2, 2] -[2,2,2,2,2,2,2,1,1] => [2, 2, 2, 2, 2, 2, 2, 1, 1] -[2,2,2,2,2,2,2,1,2] => [2, 2, 2, 2, 2, 2, 2, 1, 2] -[2,2,2,2,2,2,2,2,1] => [2, 2, 2, 2, 2, 2, 2, 2, 1] -[2,2,2,2,2,2,2,2,2] => [2, 2, 2, 2, 2, 2, 2, 2, 2] diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestLockDown2.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestLockDown2.approved.txt deleted file mode 100644 index 5ae2d335..00000000 --- a/src/ApprovalTests.NUnit3/LockDownTests.TestLockDown2.approved.txt +++ /dev/null @@ -1,4 +0,0 @@ -[1,1] => [1, 1] -[1,2] => [1, 2] -[2,1] => [2, 1] -[2,2] => [2, 2] diff --git a/src/ApprovalTests.NUnit3/LockDownTests.TestLockDown8.approved.txt b/src/ApprovalTests.NUnit3/LockDownTests.TestLockDown8.approved.txt deleted file mode 100644 index 58203bf7..00000000 --- a/src/ApprovalTests.NUnit3/LockDownTests.TestLockDown8.approved.txt +++ /dev/null @@ -1,256 +0,0 @@ -[1,1,1,1,1,1,1,1] => [1, 1, 1, 1, 1, 1, 1, 1] -[1,1,1,1,1,1,1,2] => [1, 1, 1, 1, 1, 1, 1, 2] -[1,1,1,1,1,1,2,1] => [1, 1, 1, 1, 1, 1, 2, 1] -[1,1,1,1,1,1,2,2] => [1, 1, 1, 1, 1, 1, 2, 2] -[1,1,1,1,1,2,1,1] => [1, 1, 1, 1, 1, 2, 1, 1] -[1,1,1,1,1,2,1,2] => [1, 1, 1, 1, 1, 2, 1, 2] -[1,1,1,1,1,2,2,1] => [1, 1, 1, 1, 1, 2, 2, 1] -[1,1,1,1,1,2,2,2] => [1, 1, 1, 1, 1, 2, 2, 2] -[1,1,1,1,2,1,1,1] => [1, 1, 1, 1, 2, 1, 1, 1] -[1,1,1,1,2,1,1,2] => [1, 1, 1, 1, 2, 1, 1, 2] -[1,1,1,1,2,1,2,1] => [1, 1, 1, 1, 2, 1, 2, 1] -[1,1,1,1,2,1,2,2] => [1, 1, 1, 1, 2, 1, 2, 2] -[1,1,1,1,2,2,1,1] => [1, 1, 1, 1, 2, 2, 1, 1] -[1,1,1,1,2,2,1,2] => [1, 1, 1, 1, 2, 2, 1, 2] -[1,1,1,1,2,2,2,1] => [1, 1, 1, 1, 2, 2, 2, 1] -[1,1,1,1,2,2,2,2] => [1, 1, 1, 1, 2, 2, 2, 2] -[1,1,1,2,1,1,1,1] => [1, 1, 1, 2, 1, 1, 1, 1] -[1,1,1,2,1,1,1,2] => [1, 1, 1, 2, 1, 1, 1, 2] -[1,1,1,2,1,1,2,1] => [1, 1, 1, 2, 1, 1, 2, 1] -[1,1,1,2,1,1,2,2] => [1, 1, 1, 2, 1, 1, 2, 2] -[1,1,1,2,1,2,1,1] => [1, 1, 1, 2, 1, 2, 1, 1] -[1,1,1,2,1,2,1,2] => [1, 1, 1, 2, 1, 2, 1, 2] -[1,1,1,2,1,2,2,1] => [1, 1, 1, 2, 1, 2, 2,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,2,1,2] => [2, 2, 2, 1, 2, 2, 1, 2] -[2,2,2,1,2,2,2,1] => [2, 2, 2, 1, 2, 2, 2, 1] -[2,2,2,1,2,2,2,2] => [2, 2, 2, 1, 2, 2, 2, 2] -[2,2,2,2,1,1,1,1] => [2, 2, 2, 2, 1, 1, 1, 1] -[2,2,2,2,1,1,1,2] => [2, 2, 2, 2, 1, 1, 1, 2] -[2,2,2,2,1,1,2,1] => [2, 2, 2, 2, 1, 1, 2, 1] -[2,2,2,2,1,1,2,2] => [2, 2, 2, 2, 1, 1, 2, 2] -[2,2,2,2,1,2,1,1] => [2, 2, 2, 2, 1, 2, 1, 1] -[2,2,2,2,1,2,1,2] => [2, 2, 2, 2, 1, 2, 1, 2] -[2,2,2,2,1,2,2,1] => [2, 2, 2, 2, 1, 2, 2, 1] -[2,2,2,2,1,2,2,2] => [2, 2, 2, 2, 1, 2, 2, 2] -[2,2,2,2,2,1,1,1] => [2, 2, 2, 2, 2, 1, 1, 1] -[2,2,2,2,2,1,1,2] => [2, 2, 2, 2, 2, 1, 1, 2] -[2,2,2,2,2,1,2,1] => [2, 2, 2, 2, 2, 1, 2, 1] -[2,2,2,2,2,1,2,2] => [2, 2, 2, 2, 2, 1, 2, 2] -[2,2,2,2,2,2,1,1] => [2, 2, 2, 2, 2, 2, 1, 1] -[2,2,2,2,2,2,1,2] => [2, 2, 2, 2, 2, 2, 1, 2] -[2,2,2,2,2,2,2,1] => [2, 2, 2, 2, 2, 2, 2, 1] -[2,2,2,2,2,2,2,2] => [2, 2, 2, 2, 2, 2, 2, 2] diff --git a/src/ApprovalTests.NUnit3/LockDownTests.cs b/src/ApprovalTests.NUnit3/LockDownTests.cs deleted file mode 100644 index 29b8c44d..00000000 --- a/src/ApprovalTests.NUnit3/LockDownTests.cs +++ /dev/null @@ -1,39 +0,0 @@ -[TestFixture] -[UseReporter(typeof(DiffReporter))] -public class LockDownTests -{ - public string Echo(params int[] i) => - i.ToReadableString(); - - [Test] - public void TestLockDown() - { - int[] n = [1, 2]; - CombinationApprovals.VerifyAllCombinations((a, b, c, d, e, f, g, h, i) => Echo(a, b, c, d, e, f, g, h, i), n, n, n, n, n, n, n, n, n); - } - - [Test] - public void TestLockDown8() - { - int[] n = [1, 2]; - CombinationApprovals.VerifyAllCombinations((a, b, c, d, e, f, g, h) => Echo(a, b, c, d, e, f, g, h), n, n, n, n, n, n, n, n); - } - - [Test] - public void TestLockDown2() - { - int[] n = [1, 2]; - CombinationApprovals.VerifyAllCombinations((a, b) => Echo(a, b), n, n); - } - - [Test] - [UseReporter(typeof(MachineSpecificReporter))] - public void TestExceptions() - { - using (ApprovalResults.UniqueForOs()) - { - int[] n = [0, 2]; - CombinationApprovals.VerifyAllCombinations((a, b) => a / b, n, n); - } - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.FindAbandonedApprovalFiles.approved.txt b/src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.FindAbandonedApprovalFiles.approved.txt deleted file mode 100644 index d4a28cd0..00000000 --- a/src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.FindAbandonedApprovalFiles.approved.txt +++ /dev/null @@ -1,3 +0,0 @@ -Abandoned Files: - -DeletedClass.AbandonedMethod.approved.txt diff --git a/src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.Nested.MethodName.approved.txt b/src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.Nested.MethodName.approved.txt deleted file mode 100644 index 5dd999ac..00000000 --- a/src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.Nested.MethodName.approved.txt +++ /dev/null @@ -1 +0,0 @@ -aaa \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.cs b/src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.cs deleted file mode 100644 index 96052e98..00000000 --- a/src/ApprovalTests.NUnit3/Maintenance/ApprovalMaintenanceTest.cs +++ /dev/null @@ -1,21 +0,0 @@ -[TestFixture] -public class ApprovalMaintenanceTest -{ - [Test] - public void FindAbandonedApprovalFiles() - { - using var t = new TempFile(PathUtilities.GetAdjacentFile("DeletedClass.AbandonedMethod.approved.txt")); - t.WriteAllText("Llewellyn was here"); - var path = PathUtilities.GetDirectoryForCaller(); - var list = ApprovalMaintenance.FindAbandonedFiles(path); - Approvals.VerifyAll("Abandoned Files:", list, f => f.Name); - } - - [TestFixture] - public class Nested - { - [Test] - public void MethodName() => - Approvals.Verify("aaa"); - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Set/SetTests.TestFile.approved.txt b/src/ApprovalTests.NUnit3/Set/SetTests.TestFile.approved.txt deleted file mode 100644 index 7c5bd55f..00000000 --- a/src/ApprovalTests.NUnit3/Set/SetTests.TestFile.approved.txt +++ /dev/null @@ -1,3 +0,0 @@ -2017-01-13 20:30:02.5369|INFO|Approvals.Class1|Test message -2017-01-13 20:30:02.5599|INFO|Approvals.Class1|A third line -2017-01-13 20:30:02.5599|INFO|Approvals.Class1|Another line diff --git a/src/ApprovalTests.NUnit3/Set/SetTests.TestFileWithScrubber.approved.txt b/src/ApprovalTests.NUnit3/Set/SetTests.TestFileWithScrubber.approved.txt deleted file mode 100644 index 72529dd0..00000000 --- a/src/ApprovalTests.NUnit3/Set/SetTests.TestFileWithScrubber.approved.txt +++ /dev/null @@ -1,3 +0,0 @@ -|INFO|Approvals.Class1|A third line -|INFO|Approvals.Class1|Another line -|INFO|Approvals.Class1|Test message diff --git a/src/ApprovalTests.NUnit3/Set/SetTests.TestListObject.approved.txt b/src/ApprovalTests.NUnit3/Set/SetTests.TestListObject.approved.txt deleted file mode 100644 index 19697491..00000000 --- a/src/ApprovalTests.NUnit3/Set/SetTests.TestListObject.approved.txt +++ /dev/null @@ -1,3 +0,0 @@ -[0] = apple -[1] = banana -[2] = carrot diff --git a/src/ApprovalTests.NUnit3/Set/SetTests.TestListString.approved.txt b/src/ApprovalTests.NUnit3/Set/SetTests.TestListString.approved.txt deleted file mode 100644 index 19697491..00000000 --- a/src/ApprovalTests.NUnit3/Set/SetTests.TestListString.approved.txt +++ /dev/null @@ -1,3 +0,0 @@ -[0] = apple -[1] = banana -[2] = carrot diff --git a/src/ApprovalTests.NUnit3/Set/SetTests.cs b/src/ApprovalTests.NUnit3/Set/SetTests.cs deleted file mode 100644 index 23032b6f..00000000 --- a/src/ApprovalTests.NUnit3/Set/SetTests.cs +++ /dev/null @@ -1,53 +0,0 @@ -using ApprovalTests.Set; -using System.Text.RegularExpressions; - -[TestFixture] -public class SetTests -{ - [Test] - public void TestListString() - { - // Approved file has order apple, banana, carrot - var list = new List { "carrot", "apple", "banana" }; - SetApprovals.VerifySet(list, string.Empty); - } - - public class Foo: IComparable - { - public string Bar { get; set; } - - public int CompareTo(Foo other) - { - return Bar.CompareTo(other.Bar); - } - } - - [Test] - public void TestListObject() - { - var list = new List - { - new() { Bar = "carrot" }, - new() { Bar = "apple" }, - new() { Bar = "banana" }, - }; - SetApprovals.VerifySet(list, string.Empty, f => f.Bar); - } - - [Test] - public void TestFile() - { - var path = PathUtilities.GetDirectoryForCaller(); - var file = path + "a.txt"; - SetApprovals.VerifyFileAsSet(file); - } - - [Test] - public void TestFileWithScrubber() - { - var path = PathUtilities.GetDirectoryForCaller(); - var file = path + "a.txt"; - Func scrubber = s => Regex.Replace(s, @"^[^\|]*", ""); - SetApprovals.VerifyFileAsSet(file, scrubber); - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Set/a.txt b/src/ApprovalTests.NUnit3/Set/a.txt deleted file mode 100644 index 73b40084..00000000 --- a/src/ApprovalTests.NUnit3/Set/a.txt +++ /dev/null @@ -1,3 +0,0 @@ -2017-01-13 20:30:02.5369|INFO|Approvals.Class1|Test message -2017-01-13 20:30:02.5599|INFO|Approvals.Class1|Another line -2017-01-13 20:30:02.5599|INFO|Approvals.Class1|A third line diff --git a/src/ApprovalTests.NUnit3/Writers/ExistingFileTest.TestExistFileIsApproved.approved.png b/src/ApprovalTests.NUnit3/Writers/ExistingFileTest.TestExistFileIsApproved.approved.png deleted file mode 100644 index 82d622f253d714d9c86c3470ec7de961b6ac750b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 417 zcmV;S0bc%zP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUzA4x<(RA@u(Sj!HAKn%qH|1pmq{2vA4np*l=6Ua0f5-v-@GLO#6 z?fJOB79KbVY=rQ{!C>i5#wu-7P~JNF`?e%Rg54E(PZ%TwY-Aq@*%UXWu2G z`{kNciT7MfNwU9jpVhPeee`j)Z?K{!<;z;&>2YDzS86^xy*&%O`iwkHbfp(Wf+cB7RMQHFFS;wvamc@@=G)E_DSU+`uLv7CqKj>E{R06a@nHiBlaYjCrkyY0xz zBWpJ7wexi7df`3*_v*c@h}N@bA-Scr?X~83r!jy8c-9LELH{3;G05xZe)lRlge06x z!cX23?CZd;U`>ZGL$DNCQSFsAbO;?nheVE}L+B7Xgbo37K}5(KMK}zxR&(WriterFactory.CreateTextWriter("foo")); - WriterFactory.SetTextWriterCreator(t => new MyTextWriter(t)); - Assert.IsInstanceOf(WriterFactory.CreateTextWriter("foo")); - } - - [Test] - public void TestTextWriterWithExtension() - { - Assert.IsInstanceOf(WriterFactory.CreateTextWriter("foo", ".txt")); - WriterFactory.SetTextWriterCreator((t, e) => new MyTextWriter(t, e)); - Assert.IsInstanceOf(WriterFactory.CreateTextWriter("foo", "txt")); - } -} - -public class MyTextWriter : ApprovalTextWriter -{ - public MyTextWriter(string data) - : base(data) - { - } - - public MyTextWriter(string data, string extensionWithoutDot) - : base(data, extensionWithoutDot) - { - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Xml/XmlTest.TestOrderedXmlWithAttributes.approved.xml b/src/ApprovalTests.NUnit3/Xml/XmlTest.TestOrderedXmlWithAttributes.approved.xml deleted file mode 100644 index 08047817..00000000 --- a/src/ApprovalTests.NUnit3/Xml/XmlTest.TestOrderedXmlWithAttributes.approved.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - hi - \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Xml/XmlTest.TestOrderedXmlWithDeepAttributes.approved.xml b/src/ApprovalTests.NUnit3/Xml/XmlTest.TestOrderedXmlWithDeepAttributes.approved.xml deleted file mode 100644 index a8f179f3..00000000 --- a/src/ApprovalTests.NUnit3/Xml/XmlTest.TestOrderedXmlWithDeepAttributes.approved.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - hi - \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Xml/XmlTest.TestXml.approved.xml b/src/ApprovalTests.NUnit3/Xml/XmlTest.TestXml.approved.xml deleted file mode 100644 index f14ebf84..00000000 --- a/src/ApprovalTests.NUnit3/Xml/XmlTest.TestXml.approved.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - hi - \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Xml/XmlTest.cs b/src/ApprovalTests.NUnit3/Xml/XmlTest.cs deleted file mode 100644 index f53b2bc1..00000000 --- a/src/ApprovalTests.NUnit3/Xml/XmlTest.cs +++ /dev/null @@ -1,17 +0,0 @@ -using ApprovalTests.Xml; - -[TestFixture] -public class XmlTest -{ - [Test] - public void TestXml() => - XmlApprovals.VerifyXml("hi"); - - [Test] - public void TestOrderedXmlWithAttributes() => - XmlApprovals.VerifyOrderedXml("hi"); - - [Test] - public void TestOrderedXmlWithDeepAttributes() => - XmlApprovals.VerifyOrderedXml("hi"); -} \ No newline at end of file From 3a24d07d4eb877dab9a2a7e961796cacec77219a Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 11 May 2024 17:24:04 +1000 Subject: [PATCH 03/12] . --- docs/ApprovalTests/ReportersGettingStarted.md | 7 +- .../explanations/MainConcepts.md | 9 +- readme.md | 29 +---- .../ApprovalTests.NUnit3.csproj | 10 +- .../ApprovalTestsConfig.cs | 5 +- .../ApprovalsTest.Dictionary.approved.txt | 11 -- ...pprovalsTest.DictionaryCustom.approved.txt | 11 -- ...Test.DictionaryCustomNoHeader.approved.txt | 9 -- ...pprovalsTest.DictionarySimple.approved.txt | 9 -- ...sTest.EnumerableWithFormatter.approved.txt | 3 - ...merableWithHeaderAndFormatter.approved.txt | 11 -- ...ovalsTest.EnumerableWithLabel.approved.txt | 3 - ...umerableWithLabelAndFormatter.approved.txt | 3 - .../ApprovalsTest.JsonText.approved.json | 15 --- .../ApprovalsTest.TestBytes.approved.png | Bin 417 -> 0 bytes ...pprovalsTest.TestExistingFile.approved.txt | 1 - .../ApprovalsTest.Text.approved.txt | 1 - .../ApprovalsTest.VerifyAllNull.approved.txt | 1 - ...provalsTest.VerifyAllWithNull.approved.txt | 4 - ...valsTest.VerifyNullDictionary.approved.txt | 1 - ...ovalsTest.VerifyWithExtension.approved.csv | 1 - src/ApprovalTests.NUnit3/ApprovalsTest.cs | 108 ------------------ src/ApprovalTests.NUnit3/CleanupReporter.cs | 7 -- ...xceptionTests.VerifyException.approved.txt | 1 - ...icrosoft_Windows_10_Education.approved.txt | 3 - ...crosoft_Windows_10_Enterprise.approved.txt | 3 - ...e.Microsoft_Windows_10_Home_N.approved.txt | 3 - ...race.Microsoft_Windows_10_Pro.approved.txt | 3 - ...crosoft_Windows_11_Enterprise.approved.txt | 3 - ...race.Microsoft_Windows_11_Pro.approved.txt | 3 - ...indows_Server_2016_Datacenter.approved.txt | 3 - ...indows_Server_2019_Datacenter.approved.txt | 3 - src/ApprovalTests.NUnit3/ExceptionTests.cs | 28 ----- ...numerableDoesNotMatchApproval.approved.txt | 1 - ...ests.TextDoesNotMatchApproval.approved.txt | 1 - .../FailedApprovalTests.cs | 32 ------ src/ApprovalTests.NUnit3/FileApproverTests.cs | 46 -------- src/ApprovalTests.NUnit3/ModuleInitializer.cs | 6 - ...UnitReporterTest.TestReporter.approved.txt | 0 .../{Reporters => }/NUnitReporterTest.cs | 0 .../NUnitReporterWithCleanup.cs | 0 src/ApprovalTests.NUnit3/RunMaintenance.cs | 14 --- .../SampleTest.TestList.approved.txt | 5 - src/ApprovalTests.NUnit3/SampleTest.cs | 15 --- .../StackTraceScrubberTest.cs | 24 ---- .../StringEncodingTest.TestAscii.approved.txt | 1 - ...tringEncodingTest.TestUnicode.approved.txt | 1 - .../StringEncodingTest.TestUtf8.approved.txt | 1 - .../StringEncodingTest.cs | 27 ----- src/ApprovalTests.NUnit3/a.png | Bin 417 -> 0 bytes src/ApprovalTests.NUnit3/a.txt | 1 - src/ApprovalTests.NUnit3/b.png | Bin 3257 -> 0 bytes src/ApprovalTests.NUnit3/b.txt | 1 - 53 files changed, 12 insertions(+), 476 deletions(-) delete mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.Dictionary.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.DictionaryCustom.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.DictionaryCustomNoHeader.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.DictionarySimple.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithFormatter.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithHeaderAndFormatter.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithLabel.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithLabelAndFormatter.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.JsonText.approved.json delete mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.TestBytes.approved.png delete mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.TestExistingFile.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.Text.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.VerifyAllNull.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.VerifyAllWithNull.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.VerifyNullDictionary.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.VerifyWithExtension.approved.csv delete mode 100644 src/ApprovalTests.NUnit3/ApprovalsTest.cs delete mode 100644 src/ApprovalTests.NUnit3/CleanupReporter.cs delete mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.VerifyException.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Education.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Enterprise.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Home_N.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Pro.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_11_Enterprise.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_11_Pro.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_Server_2016_Datacenter.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_Server_2019_Datacenter.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/ExceptionTests.cs delete mode 100644 src/ApprovalTests.NUnit3/FailedApprovalTests.EnumerableDoesNotMatchApproval.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/FailedApprovalTests.TextDoesNotMatchApproval.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/FailedApprovalTests.cs delete mode 100644 src/ApprovalTests.NUnit3/FileApproverTests.cs delete mode 100644 src/ApprovalTests.NUnit3/ModuleInitializer.cs rename src/ApprovalTests.NUnit3/{Reporters => }/NUnitReporterTest.TestReporter.approved.txt (100%) rename src/ApprovalTests.NUnit3/{Reporters => }/NUnitReporterTest.cs (100%) rename src/ApprovalTests.NUnit3/{Reporters => }/NUnitReporterWithCleanup.cs (100%) delete mode 100644 src/ApprovalTests.NUnit3/RunMaintenance.cs delete mode 100644 src/ApprovalTests.NUnit3/SampleTest.TestList.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/SampleTest.cs delete mode 100644 src/ApprovalTests.NUnit3/StackTraceScrubberTest.cs delete mode 100644 src/ApprovalTests.NUnit3/StringEncodingTest.TestAscii.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/StringEncodingTest.TestUnicode.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/StringEncodingTest.TestUtf8.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/StringEncodingTest.cs delete mode 100644 src/ApprovalTests.NUnit3/a.png delete mode 100644 src/ApprovalTests.NUnit3/a.txt delete mode 100644 src/ApprovalTests.NUnit3/b.png delete mode 100644 src/ApprovalTests.NUnit3/b.txt diff --git a/docs/ApprovalTests/ReportersGettingStarted.md b/docs/ApprovalTests/ReportersGettingStarted.md index eae41059..b5280044 100644 --- a/docs/ApprovalTests/ReportersGettingStarted.md +++ b/docs/ApprovalTests/ReportersGettingStarted.md @@ -34,12 +34,7 @@ ApprovalTests suggest you make a assembly level configuration file for approvalt ```cs [assembly: UseReporter(typeof(DiffReporter))] ``` -snippet source | anchor - -```cs -[assembly: UseReporter(typeof(DiffReporter))] -``` -snippet source | anchor +snippet source | anchor diff --git a/docs/ApprovalTests/explanations/MainConcepts.md b/docs/ApprovalTests/explanations/MainConcepts.md index 7cd8c986..239b71f7 100644 --- a/docs/ApprovalTests/explanations/MainConcepts.md +++ b/docs/ApprovalTests/explanations/MainConcepts.md @@ -63,14 +63,7 @@ Let's take the example: public void Text() => Approvals.Verify("should be approved"); ``` -snippet source | anchor - -```cs -[Test] -public void Text() => - Approvals.Verify("should be approved"); -``` -snippet source | anchor +snippet source | anchor This call brings together 3 things + default Approver to produce a `.received.` file which is compared to an `.approved.` file. diff --git a/readme.md b/readme.md index 57f47072..4689c373 100644 --- a/readme.md +++ b/readme.md @@ -101,23 +101,7 @@ public class SampleTest } } ``` -snippet source | anchor - -```cs -[UseReporter(typeof(VisualStudioReporter))] -[TestFixture] -public class SampleTest -{ - [Test] - public void TestList() - { - var names = new[] {"Llewellyn", "James", "Dan", "Jason", "Katrina"}; - Array.Sort(names); - Approvals.VerifyAll(names, label: ""); - } -} -``` -snippet source | anchor +snippet source | anchor Will Produce a File @@ -133,16 +117,7 @@ Will Produce a File [3] = Katrina [4] = Llewellyn ``` -snippet source | anchor - -```txt -[0] = Dan -[1] = James -[2] = Jason -[3] = Katrina -[4] = Llewellyn -``` -snippet source | anchor +snippet source | anchor It will also open these 2 files (`.received.` & `.approved.` ) in a diff editor. diff --git a/src/ApprovalTests.NUnit3/ApprovalTests.NUnit3.csproj b/src/ApprovalTests.NUnit3/ApprovalTests.NUnit3.csproj index aa292a46..645b6a2e 100644 --- a/src/ApprovalTests.NUnit3/ApprovalTests.NUnit3.csproj +++ b/src/ApprovalTests.NUnit3/ApprovalTests.NUnit3.csproj @@ -16,11 +16,15 @@ - - - + + + .cs + NUnitReporterTest + NUnitReporterTest.cs + + \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ApprovalTestsConfig.cs b/src/ApprovalTests.NUnit3/ApprovalTestsConfig.cs index 46c5404d..2d2846ae 100644 --- a/src/ApprovalTests.NUnit3/ApprovalTestsConfig.cs +++ b/src/ApprovalTests.NUnit3/ApprovalTestsConfig.cs @@ -1,4 +1 @@ -// begin-snippet: config_file - -[assembly: UseReporter(typeof(DiffReporter))] -// end-snippet \ No newline at end of file +[assembly: UseReporter(typeof(DiffReporter))] \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.Dictionary.approved.txt b/src/ApprovalTests.NUnit3/ApprovalsTest.Dictionary.approved.txt deleted file mode 100644 index 4f60dd1a..00000000 --- a/src/ApprovalTests.NUnit3/ApprovalsTest.Dictionary.approved.txt +++ /dev/null @@ -1,11 +0,0 @@ -Firefly - -2nd In Command => Zoey -Caption => Mal -Companion => Inara -Doctor => Simon -Mechanic => Kaylee -Muscle => Jayne -Pastor => Book -Pilot => Wash -Stowaway => River diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.DictionaryCustom.approved.txt b/src/ApprovalTests.NUnit3/ApprovalsTest.DictionaryCustom.approved.txt deleted file mode 100644 index a24e291f..00000000 --- a/src/ApprovalTests.NUnit3/ApprovalsTest.DictionaryCustom.approved.txt +++ /dev/null @@ -1,11 +0,0 @@ -Firefly - -"2nd In Command" => Zoey -"Caption" => Mal -"Companion" => Inara -"Doctor" => Simon -"Mechanic" => Kaylee -"Muscle" => Jayne -"Pastor" => Book -"Pilot" => Wash -"Stowaway" => River diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.DictionaryCustomNoHeader.approved.txt b/src/ApprovalTests.NUnit3/ApprovalsTest.DictionaryCustomNoHeader.approved.txt deleted file mode 100644 index 2a713d0b..00000000 --- a/src/ApprovalTests.NUnit3/ApprovalsTest.DictionaryCustomNoHeader.approved.txt +++ /dev/null @@ -1,9 +0,0 @@ -"2nd In Command" => Zoey -"Caption" => Mal -"Companion" => Inara -"Doctor" => Simon -"Mechanic" => Kaylee -"Muscle" => Jayne -"Pastor" => Book -"Pilot" => Wash -"Stowaway" => River diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.DictionarySimple.approved.txt b/src/ApprovalTests.NUnit3/ApprovalsTest.DictionarySimple.approved.txt deleted file mode 100644 index 636f9680..00000000 --- a/src/ApprovalTests.NUnit3/ApprovalsTest.DictionarySimple.approved.txt +++ /dev/null @@ -1,9 +0,0 @@ -2nd In Command => Zoey -Caption => Mal -Companion => Inara -Doctor => Simon -Mechanic => Kaylee -Muscle => Jayne -Pastor => Book -Pilot => Wash -Stowaway => River diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithFormatter.approved.txt b/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithFormatter.approved.txt deleted file mode 100644 index 8c175351..00000000 --- a/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithFormatter.approved.txt +++ /dev/null @@ -1,3 +0,0 @@ -3 -3 -3 diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithHeaderAndFormatter.approved.txt b/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithHeaderAndFormatter.approved.txt deleted file mode 100644 index f16360c1..00000000 --- a/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithHeaderAndFormatter.approved.txt +++ /dev/null @@ -1,11 +0,0 @@ -Llewellyn - -L => 76 -l => 108 -e => 101 -w => 119 -e => 101 -l => 108 -l => 108 -y => 121 -n => 110 diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithLabel.approved.txt b/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithLabel.approved.txt deleted file mode 100644 index a77679dd..00000000 --- a/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithLabel.approved.txt +++ /dev/null @@ -1,3 +0,0 @@ -collection[0] = abc -collection[1] = 123 -collection[2] = !@# diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithLabelAndFormatter.approved.txt b/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithLabelAndFormatter.approved.txt deleted file mode 100644 index 05bba2d4..00000000 --- a/src/ApprovalTests.NUnit3/ApprovalsTest.EnumerableWithLabelAndFormatter.approved.txt +++ /dev/null @@ -1,3 +0,0 @@ -collection[0] = 3 -collection[1] = 3 -collection[2] = 3 diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.JsonText.approved.json b/src/ApprovalTests.NUnit3/ApprovalsTest.JsonText.approved.json deleted file mode 100644 index 65585d56..00000000 --- a/src/ApprovalTests.NUnit3/ApprovalsTest.JsonText.approved.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "GivenNames": "John", - "FamilyName": "Smith", - "Spouse": "Jill", - "Address": { - "Street": "1 Puddle Lane", - "Suburb": null, - "Country": "USA" - }, - "Children": [ - "Sam", - "Mary" - ], - "Title": "Mr" -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ApprovalsTest.TestBytes.approved.png b/src/ApprovalTests.NUnit3/ApprovalsTest.TestBytes.approved.png deleted file mode 100644 index 82d622f253d714d9c86c3470ec7de961b6ac750b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 417 zcmV;S0bc%zP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUzA4x<(RA@u(Sj!HAKn%qH|1pmq{2vA4np*l=6Ua0f5-v-@GLO#6 z?fJOB79KbVY=rQ{!C>i5#wu-7P~JNF`?e%Rg54E(PZ%TwY-Aq@*%UXWu2G z`{kNciT7MfNwU9jpVhPeee`j)Z?K{!<;z;&>2YDzS86^xy*&%O`iwkHbfp(Wf+cB7RMQHFFS;wvamc@@=G)E_DSU+`uLv7CqKj>E{R06a@nHiBlaYjCrkyY0xz zBWpJ7wexi7df`3*_v*c@h}N@bA-Scr?X~83r!jy8c-9LELH{3;G05xZe)lRlge06x z!cX23?CZd;U`>ZGL$DNCQSFsAbO;?nheVE}L+B7Xgbo37K}5(KMK}zxR& - Approvals.Verify("should be approved"); - // end-snippet - - [Test] - public void VerifyWithExtension() => - Approvals.VerifyWithExtension("should,be,approved", ".csv"); - - [Test] - public void EnumerableWithLabel() => - Approvals.VerifyAll(text, "collection"); - - [Test] - public void TestExistingFile() - { - var path = PathUtilities.GetDirectoryForCaller(); - var copy = path + "copyOfa.txt"; - File.Copy(path + "a.txt", copy, true); - Approvals.VerifyFile(copy); - } - - [Test] - public void TestBytes() - { - var path = PathUtilities.GetDirectoryForCaller(); - Approvals.VerifyBinaryFile(File.ReadAllBytes(path + "a.png"), "png"); - } - - [Test] - public void EnumerableWithLabelAndFormatter() => - Approvals.VerifyAll(text, "collection", t => "" + t.Length); - - [Test] - public void EnumerableWithHeaderAndFormatter() - { - var word = "Llewellyn"; - Approvals.VerifyAll(word, word.ToCharArray(), c => c + " => " + (int) c); - } - - [Test] - public void VerifyAllWithNull() - { - var words = new[] {"abc", null, "123", "!@#"}; - Approvals.VerifyAll(words, ""); - } - - [Test] - public void VerifyAllNull() - { - string[] words = null; - Approvals.VerifyAll(words, "words"); - } - - [Test] - public void VerifyNullDictionary() - { - Dictionary words = null; - Approvals.VerifyAll(words); - } - - [Test] - public void DictionarySimple() => - Approvals.VerifyAll(FireFlyMap()); - - [Test] - public void Dictionary() => - Approvals.VerifyAll("Firefly", FireFlyMap()); - - [Test] - public void DictionaryCustom() => - Approvals.VerifyAll("Firefly", FireFlyMap(), (k, v) => $"\"{k}\" => {v}"); - - [Test] - public void DictionaryCustomNoHeader() => - Approvals.VerifyAll(FireFlyMap(), (k, v) => $"\"{k}\" => {v}"); - - static Dictionary FireFlyMap() => - new() - { - {"Caption", "Mal"}, - {"2nd In Command", "Zoey"}, - {"Pilot", "Wash"}, - {"Companion", "Inara"}, - {"Muscle", "Jayne"}, - {"Mechanic", "Kaylee"}, - {"Doctor", "Simon"}, - {"Pastor", "Book"}, - {"Stowaway", "River"} - }; - - [Test] - public void EnumerableWithFormatter() => - Approvals.VerifyAll(text, t => "" + t.Length); - - [Test] - public void JsonText() - { - var json = """{"GivenNames":"John","FamilyName":"Smith","Spouse":"Jill","Address":{"Street":"1 Puddle Lane","Suburb":null,"Country":"USA"},"Children":["Sam","Mary"],"Title":"Mr"}"""; - Approvals.VerifyJson(json); - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/CleanupReporter.cs b/src/ApprovalTests.NUnit3/CleanupReporter.cs deleted file mode 100644 index e8eb1e37..00000000 --- a/src/ApprovalTests.NUnit3/CleanupReporter.cs +++ /dev/null @@ -1,7 +0,0 @@ -public class CleanupReporter : IApprovalFailureReporter -{ - public void Report(string approved, string received) => - File.Delete(received); - - public bool ApprovedWhenReported() => false; -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyException.approved.txt b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyException.approved.txt deleted file mode 100644 index 6a16afc1..00000000 --- a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyException.approved.txt +++ /dev/null @@ -1 +0,0 @@ -System.Exception: The Message \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Education.approved.txt b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Education.approved.txt deleted file mode 100644 index b2144ff3..00000000 --- a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Education.approved.txt +++ /dev/null @@ -1,3 +0,0 @@ -System.Exception: https:.../242 - at ExceptionTests.<>c.() in ...\ExceptionTests.cs - at ApprovalUtilities.Utilities.ExceptionUtilities.GetException(Action action) in ...\ExceptionUtilities.cs \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Enterprise.approved.txt b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Enterprise.approved.txt deleted file mode 100644 index b2144ff3..00000000 --- a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Enterprise.approved.txt +++ /dev/null @@ -1,3 +0,0 @@ -System.Exception: https:.../242 - at ExceptionTests.<>c.() in ...\ExceptionTests.cs - at ApprovalUtilities.Utilities.ExceptionUtilities.GetException(Action action) in ...\ExceptionUtilities.cs \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Home_N.approved.txt b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Home_N.approved.txt deleted file mode 100644 index b2144ff3..00000000 --- a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Home_N.approved.txt +++ /dev/null @@ -1,3 +0,0 @@ -System.Exception: https:.../242 - at ExceptionTests.<>c.() in ...\ExceptionTests.cs - at ApprovalUtilities.Utilities.ExceptionUtilities.GetException(Action action) in ...\ExceptionUtilities.cs \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Pro.approved.txt b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Pro.approved.txt deleted file mode 100644 index b2144ff3..00000000 --- a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_10_Pro.approved.txt +++ /dev/null @@ -1,3 +0,0 @@ -System.Exception: https:.../242 - at ExceptionTests.<>c.() in ...\ExceptionTests.cs - at ApprovalUtilities.Utilities.ExceptionUtilities.GetException(Action action) in ...\ExceptionUtilities.cs \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_11_Enterprise.approved.txt b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_11_Enterprise.approved.txt deleted file mode 100644 index b2144ff3..00000000 --- a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_11_Enterprise.approved.txt +++ /dev/null @@ -1,3 +0,0 @@ -System.Exception: https:.../242 - at ExceptionTests.<>c.() in ...\ExceptionTests.cs - at ApprovalUtilities.Utilities.ExceptionUtilities.GetException(Action action) in ...\ExceptionUtilities.cs \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_11_Pro.approved.txt b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_11_Pro.approved.txt deleted file mode 100644 index b2144ff3..00000000 --- a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_11_Pro.approved.txt +++ /dev/null @@ -1,3 +0,0 @@ -System.Exception: https:.../242 - at ExceptionTests.<>c.() in ...\ExceptionTests.cs - at ApprovalUtilities.Utilities.ExceptionUtilities.GetException(Action action) in ...\ExceptionUtilities.cs \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_Server_2016_Datacenter.approved.txt b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_Server_2016_Datacenter.approved.txt deleted file mode 100644 index b2144ff3..00000000 --- a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_Server_2016_Datacenter.approved.txt +++ /dev/null @@ -1,3 +0,0 @@ -System.Exception: https:.../242 - at ExceptionTests.<>c.() in ...\ExceptionTests.cs - at ApprovalUtilities.Utilities.ExceptionUtilities.GetException(Action action) in ...\ExceptionUtilities.cs \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_Server_2019_Datacenter.approved.txt b/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_Server_2019_Datacenter.approved.txt deleted file mode 100644 index b2144ff3..00000000 --- a/src/ApprovalTests.NUnit3/ExceptionTests.VerifyExceptionWithStacktrace.Microsoft_Windows_Server_2019_Datacenter.approved.txt +++ /dev/null @@ -1,3 +0,0 @@ -System.Exception: https:.../242 - at ExceptionTests.<>c.() in ...\ExceptionTests.cs - at ApprovalUtilities.Utilities.ExceptionUtilities.GetException(Action action) in ...\ExceptionUtilities.cs \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ExceptionTests.cs b/src/ApprovalTests.NUnit3/ExceptionTests.cs deleted file mode 100644 index 7e1012d9..00000000 --- a/src/ApprovalTests.NUnit3/ExceptionTests.cs +++ /dev/null @@ -1,28 +0,0 @@ -[TestFixture] -[UseReporter(typeof(MachineSpecificReporter))] -public class ExceptionTests -{ - -#if NET6_0_OR_GREATER - - [Test] - public void VerifyExceptionWithStacktrace() - { - using (ApprovalResults.UniqueForOs()) - { - Action wrapper = () => throw new("https://github.com/approvals/ApprovalTests.Net/issues/242"); - var e = ExceptionUtilities.GetException(wrapper); - Approvals.VerifyExceptionWithStacktrace(e); - } - } - -#endif - - [Test] - public void VerifyException() - { - Action wrapper = () => throw new("The Message"); - var e = ExceptionUtilities.GetException(wrapper); - Approvals.VerifyException(e); - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/FailedApprovalTests.EnumerableDoesNotMatchApproval.approved.txt b/src/ApprovalTests.NUnit3/FailedApprovalTests.EnumerableDoesNotMatchApproval.approved.txt deleted file mode 100644 index 93ac1f7e..00000000 --- a/src/ApprovalTests.NUnit3/FailedApprovalTests.EnumerableDoesNotMatchApproval.approved.txt +++ /dev/null @@ -1 +0,0 @@ -collection[0] = Does match diff --git a/src/ApprovalTests.NUnit3/FailedApprovalTests.TextDoesNotMatchApproval.approved.txt b/src/ApprovalTests.NUnit3/FailedApprovalTests.TextDoesNotMatchApproval.approved.txt deleted file mode 100644 index 33bf5a1d..00000000 --- a/src/ApprovalTests.NUnit3/FailedApprovalTests.TextDoesNotMatchApproval.approved.txt +++ /dev/null @@ -1 +0,0 @@ -should pass diff --git a/src/ApprovalTests.NUnit3/FailedApprovalTests.cs b/src/ApprovalTests.NUnit3/FailedApprovalTests.cs deleted file mode 100644 index 0fbd7887..00000000 --- a/src/ApprovalTests.NUnit3/FailedApprovalTests.cs +++ /dev/null @@ -1,32 +0,0 @@ -[TestFixture] -[UseReporter(typeof(CleanupReporter))] -public class FailedApprovalTests -{ - static void AssertThrows(TestDelegate code) where T : Exception - { - using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) - { - Assert.Throws(code); - } - } - - [Test] - public void EnumerableDoesNotMatchApproval() => - AssertThrows(() => - Approvals.VerifyAll(new[] {"Does not match"}, "collection")); - - [Test] - public void EnumerableNotApprovedYet() => - AssertThrows(() => - Approvals.VerifyAll(new[] {"Not approved"}, "collection")); - - [Test] - public void TextDoesNotMatchApproval() => - AssertThrows(() => - Approvals.Verify("should fail with mismatch")); - - [Test] - public void TextNotApprovedYet() => - AssertThrows(() => - Approvals.Verify("should fail with a missing exception")); -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/FileApproverTests.cs b/src/ApprovalTests.NUnit3/FileApproverTests.cs deleted file mode 100644 index 097ce01a..00000000 --- a/src/ApprovalTests.NUnit3/FileApproverTests.cs +++ /dev/null @@ -1,46 +0,0 @@ -[TestFixture] -public class FileApproverTests -{ - [Test] - public void TestFailureDueToMissingApproval() => - AssertApprover("a.txt", "non_existing_file.txt", false); - - [Test] - public void TestFailureDueToMismatch() => - AssertApprover("a.txt", "b.txt", false); - - [Test] - public void TestSuccess() => - AssertApprover("a.txt", "a.txt", true); - - [Test] - public void LineEndingsAreIgnored() - { - var basePath = PathUtilities.GetDirectoryForCaller(); - var approvedFile = basePath + "UnixLineEndings.txt"; - var receivedFile = basePath + "WindowsLineEndings.txt"; - File.WriteAllText(approvedFile, "Foo\nBar"); - File.WriteAllText(receivedFile, "Foo\r\nBar"); - var fileApprover = new FileApprover(null, null, true).Approve(approvedFile, receivedFile); - Assert.IsNull(fileApprover); - } - - [Test] - public void LineEndingAreNotIgnored() - { - var basePath = PathUtilities.GetDirectoryForCaller(); - var approvedFile = basePath + "UnixLineEndings.txt"; - var receivedFile = basePath + "WindowsLineEndings.txt"; - File.WriteAllText(approvedFile, "Foo\nBar"); - File.WriteAllText(receivedFile, "Foo\r\nBar"); - var fileApprover = new FileApprover(null, null).Approve(approvedFile, receivedFile); - Assert.IsInstanceOf(fileApprover); - } - - static void AssertApprover(string receivedFile, string approvedFile, bool expected) - { - var basePath = PathUtilities.GetDirectoryForCaller(); - var fileApprover = new FileApprover(null, null).Approve(basePath + approvedFile, basePath + receivedFile); - Assert.AreEqual(expected, fileApprover == null); - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/ModuleInitializer.cs b/src/ApprovalTests.NUnit3/ModuleInitializer.cs deleted file mode 100644 index 7f08d9bd..00000000 --- a/src/ApprovalTests.NUnit3/ModuleInitializer.cs +++ /dev/null @@ -1,6 +0,0 @@ -public static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() => - AttributeStackTraceParser.FileInfoIsValidFilter = _ => true; -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/NUnitReporterTest.TestReporter.approved.txt b/src/ApprovalTests.NUnit3/NUnitReporterTest.TestReporter.approved.txt similarity index 100% rename from src/ApprovalTests.NUnit3/Reporters/NUnitReporterTest.TestReporter.approved.txt rename to src/ApprovalTests.NUnit3/NUnitReporterTest.TestReporter.approved.txt diff --git a/src/ApprovalTests.NUnit3/Reporters/NUnitReporterTest.cs b/src/ApprovalTests.NUnit3/NUnitReporterTest.cs similarity index 100% rename from src/ApprovalTests.NUnit3/Reporters/NUnitReporterTest.cs rename to src/ApprovalTests.NUnit3/NUnitReporterTest.cs diff --git a/src/ApprovalTests.NUnit3/Reporters/NUnitReporterWithCleanup.cs b/src/ApprovalTests.NUnit3/NUnitReporterWithCleanup.cs similarity index 100% rename from src/ApprovalTests.NUnit3/Reporters/NUnitReporterWithCleanup.cs rename to src/ApprovalTests.NUnit3/NUnitReporterWithCleanup.cs diff --git a/src/ApprovalTests.NUnit3/RunMaintenance.cs b/src/ApprovalTests.NUnit3/RunMaintenance.cs deleted file mode 100644 index 77b90bd4..00000000 --- a/src/ApprovalTests.NUnit3/RunMaintenance.cs +++ /dev/null @@ -1,14 +0,0 @@ -#if(NET48) -[TestFixture] -public class RunMaintenance -{ - [Test] - public void EnsureNoAbandonedFiles() => - ApprovalMaintenance.VerifyNoAbandonedFiles( - "CustomNamerShouldBeSubstitutable.approved.txt", - "StringEncodingTest.TestUnicode.approved.txt", - "AsyncTests.TestAsyncExceptionFromVoid", - "VerifyExceptionWithStacktrace" - ); -} -#endif \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/SampleTest.TestList.approved.txt b/src/ApprovalTests.NUnit3/SampleTest.TestList.approved.txt deleted file mode 100644 index de734d06..00000000 --- a/src/ApprovalTests.NUnit3/SampleTest.TestList.approved.txt +++ /dev/null @@ -1,5 +0,0 @@ -[0] = Dan -[1] = James -[2] = Jason -[3] = Katrina -[4] = Llewellyn diff --git a/src/ApprovalTests.NUnit3/SampleTest.cs b/src/ApprovalTests.NUnit3/SampleTest.cs deleted file mode 100644 index c656cc8d..00000000 --- a/src/ApprovalTests.NUnit3/SampleTest.cs +++ /dev/null @@ -1,15 +0,0 @@ -// begin-snippet: sample_test -[UseReporter(typeof(VisualStudioReporter))] -[TestFixture] -public class SampleTest -{ - [Test] - public void TestList() - { - var names = new[] {"Llewellyn", "James", "Dan", "Jason", "Katrina"}; - Array.Sort(names); - Approvals.VerifyAll(names, label: ""); - } -} - -// end-snippet \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/StackTraceScrubberTest.cs b/src/ApprovalTests.NUnit3/StackTraceScrubberTest.cs deleted file mode 100644 index 28f89707..00000000 --- a/src/ApprovalTests.NUnit3/StackTraceScrubberTest.cs +++ /dev/null @@ -1,24 +0,0 @@ -[TestFixture] -public class StackTraceScrubberTest -{ - [Test] - public void TestDashedPath() - { - const string Path = @"C:\code\ApprovalTests - Net\Persistence\Datasets\DatasetTest.cs"; - Assert.AreEqual("...\\DatasetTest.cs", StackTraceScrubber.ScrubPaths(Path)); - } - - [Test] - public void TestDashedPathOnMac() - { - const string Path = "/Users/approver/code/ApprovalTests - Net/Persistence/Datasets/DatasetTest.cs"; - Assert.AreEqual(".../DatasetTest.cs", StackTraceScrubber.ScrubPaths(Path)); - } - - [Test] - public void TestKeyValuePair() - { - const string Value = "name: File.foo"; - Assert.AreEqual(Value, StackTraceScrubber.ScrubPaths(Value)); - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/StringEncodingTest.TestAscii.approved.txt b/src/ApprovalTests.NUnit3/StringEncodingTest.TestAscii.approved.txt deleted file mode 100644 index a259b282..00000000 --- a/src/ApprovalTests.NUnit3/StringEncodingTest.TestAscii.approved.txt +++ /dev/null @@ -1 +0,0 @@ -ascii \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/StringEncodingTest.TestUnicode.approved.txt b/src/ApprovalTests.NUnit3/StringEncodingTest.TestUnicode.approved.txt deleted file mode 100644 index 99e64747..00000000 --- a/src/ApprovalTests.NUnit3/StringEncodingTest.TestUnicode.approved.txt +++ /dev/null @@ -1 +0,0 @@ -eënt \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/StringEncodingTest.TestUtf8.approved.txt b/src/ApprovalTests.NUnit3/StringEncodingTest.TestUtf8.approved.txt deleted file mode 100644 index 00860fa0..00000000 --- a/src/ApprovalTests.NUnit3/StringEncodingTest.TestUtf8.approved.txt +++ /dev/null @@ -1 +0,0 @@ -UƬf8 \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/StringEncodingTest.cs b/src/ApprovalTests.NUnit3/StringEncodingTest.cs deleted file mode 100644 index a50a2cae..00000000 --- a/src/ApprovalTests.NUnit3/StringEncodingTest.cs +++ /dev/null @@ -1,27 +0,0 @@ -[TestFixture] -[UseReporter(typeof(ClipboardReporter))] -public class StringEncodingTest -{ - [Test] - public void TestUtf8() - { - var text = "UƬf8"; - Approvals.Verify(text); - } - - [Test] - public void TestAscii() - { - var text = "ascii"; - Approvals.Verify(text); - } - -#if(NETFRAMEWORK) - [Test] - public void TestUnicode() - { - var text = System.Text.Encoding.Default.GetString([101, 235, 110, 116]); - Approvals.Verify(text); - } -#endif -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/a.png b/src/ApprovalTests.NUnit3/a.png deleted file mode 100644 index 82d622f253d714d9c86c3470ec7de961b6ac750b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 417 zcmV;S0bc%zP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUzA4x<(RA@u(Sj!HAKn%qH|1pmq{2vA4np*l=6Ua0f5-v-@GLO#6 z?fJOB79KbVY=rQ{!C>i5#wu-7P~JNF`?e%Rg54E(PZ%TwY-Aq@*%UXWu2G z`{kNciT7MfNwU9jpVhPeee`j)Z?K{!<;z;&>2YDzS86^xy*&%O`iwkHbfp(Wf+cB7RMQHFFS;wvamc@@=G)E_DSU+`uLv7CqKj>E{R06a@nHiBlaYjCrkyY0xz zBWpJ7wexi7df`3*_v*c@h}N@bA-Scr?X~83r!jy8c-9LELH{3;G05xZe)lRlge06x z!cX23?CZd;U`>ZGL$DNCQSFsAbO;?nheVE}L+B7Xgbo37K}5(KMK}zxR&LI78Ds+1Y|7P->{$f;d1$WF1a5rcb~hf zONfg`ID0t*01z?ws3ZU!Q2*L7n2jkdZz{4mhr*=jNH8$(t+WA0aztzd07EReISXpT zr%CvvSOCi21AuW0fCC%F*aDy^5CBys0AcL_cv9K?L@WRZ6Yu<@y2uZbJD+lMcaJ=BT^$q_NPCm7s83&b+Z)rAVNO1v zCM|w%+&lPF)YKw6G+Ww~vq-Yw6cyHFcA;6PS!6NChK*(C;`vA%0navE3}EQDL|Ki) z!OeV(NBnOHw!bvaik8oOIlZlkvp|0Z~fxy}=rNR>a9`G^lbTp`!a$R0h0CZA7%b0^A% z4z!&Gf6>}@c{}J;+HH}Qg!NmN%iN;151#5%`J&^EkB9EUl5_<_u-0n*f4Ra45LS)1 zjwQ!#@{te<5=rj&Y^r!&)1^RG5a~ac8x18drqwOluCG5*V_dPWR%7>+*A`YbG$_&b zbe~<8EnTiP>^==s^xd2pV z_ZujyymxjnD;C_&?2hi+#T-%y&MG+K!3}QC0fg+ihq+mw5$xDr4|_k@=fSQAc0IK3 z1N%PwzwZGgBji;9`l#0vK~N~Qq5{|1XhpLjh%bAd2&BFr9Q)4Fef62`w*WC8$3+c9 HW-|W)A|0Di diff --git a/src/ApprovalTests.NUnit3/b.txt b/src/ApprovalTests.NUnit3/b.txt deleted file mode 100644 index 36c6edb4..00000000 --- a/src/ApprovalTests.NUnit3/b.txt +++ /dev/null @@ -1 +0,0 @@ -text b \ No newline at end of file From e9044071064df9fe6d59f1b4e4a4f6c16fcd5aa6 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 11 May 2024 17:26:55 +1000 Subject: [PATCH 04/12] . --- docs/ApprovalTests/Features.md | 25 +----- .../CustomizingDiffToolSelectionOrder.md | 28 +----- src/ApprovalTests.NUnit3/GlobalUsings.cs | 25 +----- .../Reporters/AssemblyLevelTest.cs | 12 --- .../Reporters/CustomDiffReporter.cs | 22 ----- ...ingReporterTest.TestException.approved.txt | 1 - .../Reporters/FirstWorkingReporterTest.cs | 72 --------------- ...extReporterTest.CSharpStrings.approved.txt | 9 -- .../Reporters/InlineTextReporterTest.cs | 64 ------------- ...ctionReporterTest.TestComment.approved.txt | 31 ------- .../Reporters/IntroductionReporterTest.cs | 7 -- .../Reporters/MultiReporterTest.cs | 27 ------ ...boardReporterTest.TestCommand.approved.txt | 1 - .../PowerShellClipboardReporterTest.cs | 7 -- .../Reporters/RecordingReporter.cs | 18 ---- .../Reporters/ReporterFactoryTest.cs | 89 ------------------- ...estInvalidReporterShouldThrow.approved.txt | 9 -- ...ithInvalidReporterShouldThrow.approved.txt | 9 -- .../Reporters/ReporterTest.cs | 41 --------- ...oiseImageDiffTest.TestIsImage.approved.txt | 9 -- .../Reporters/TortoiseImageDiffTest.cs | 21 ----- src/ApprovalTests.NUnit3/UnixLineEndings.txt | 2 - .../WindowsLineEndings.txt | 2 - 23 files changed, 4 insertions(+), 527 deletions(-) delete mode 100644 src/ApprovalTests.NUnit3/Reporters/AssemblyLevelTest.cs delete mode 100644 src/ApprovalTests.NUnit3/Reporters/CustomDiffReporter.cs delete mode 100644 src/ApprovalTests.NUnit3/Reporters/FirstWorkingReporterTest.TestException.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Reporters/FirstWorkingReporterTest.cs delete mode 100644 src/ApprovalTests.NUnit3/Reporters/InlineTextReporterTest.CSharpStrings.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Reporters/InlineTextReporterTest.cs delete mode 100644 src/ApprovalTests.NUnit3/Reporters/IntroductionReporterTest.TestComment.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Reporters/IntroductionReporterTest.cs delete mode 100644 src/ApprovalTests.NUnit3/Reporters/MultiReporterTest.cs delete mode 100644 src/ApprovalTests.NUnit3/Reporters/PowerShellClipboardReporterTest.TestCommand.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Reporters/PowerShellClipboardReporterTest.cs delete mode 100644 src/ApprovalTests.NUnit3/Reporters/RecordingReporter.cs delete mode 100644 src/ApprovalTests.NUnit3/Reporters/ReporterFactoryTest.cs delete mode 100644 src/ApprovalTests.NUnit3/Reporters/ReporterTest.TestInvalidReporterShouldThrow.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Reporters/ReporterTest.TestMultipleWithInvalidReporterShouldThrow.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Reporters/ReporterTest.cs delete mode 100644 src/ApprovalTests.NUnit3/Reporters/TortoiseImageDiffTest.TestIsImage.approved.txt delete mode 100644 src/ApprovalTests.NUnit3/Reporters/TortoiseImageDiffTest.cs delete mode 100644 src/ApprovalTests.NUnit3/UnixLineEndings.txt delete mode 100644 src/ApprovalTests.NUnit3/WindowsLineEndings.txt diff --git a/docs/ApprovalTests/Features.md b/docs/ApprovalTests/Features.md index 332a346c..0411f508 100644 --- a/docs/ApprovalTests/Features.md +++ b/docs/ApprovalTests/Features.md @@ -34,15 +34,7 @@ var actual = header.MakeHeading("I am ten chars"); var expected = ""; Approvals.AssertText(expected, actual); ``` -snippet source | anchor - -```cs -var header = new Header(); -var actual = header.MakeHeading("I am ten chars"); -var expected = ""; -Approvals.AssertText(expected, actual); -``` -snippet source | anchor +snippet source | anchor When you do this, it will copy the c# for the `.received.` to your clipboard, so you can paste it in-line. @@ -61,20 +53,7 @@ var expected = new[]{ }; Approvals.AssertText(expected, actual); ``` -snippet source | anchor - -```cs -var header = new Header(); -var actual = header.MakeHeading("I am ten chars"); -var expected = new[]{ - "**************", - "I am ten chars", - "**************", - -}; -Approvals.AssertText(expected, actual); -``` -snippet source | anchor +snippet source | anchor diff --git a/docs/ApprovalTests/howtos/CustomizingDiffToolSelectionOrder.md b/docs/ApprovalTests/howtos/CustomizingDiffToolSelectionOrder.md index 507bd0d1..b0cf3d86 100644 --- a/docs/ApprovalTests/howtos/CustomizingDiffToolSelectionOrder.md +++ b/docs/ApprovalTests/howtos/CustomizingDiffToolSelectionOrder.md @@ -44,33 +44,7 @@ public class CustomDiffReporter : } } ``` -snippet source | anchor - -```cs -using ApprovalTests.Reporters.TestFrameworks; - -public class CustomDiffReporter : - FirstWorkingReporter -{ - public CustomDiffReporter() - : base( - //TODO: re-order or remove as required - BeyondCompareReporter.INSTANCE, - TortoiseDiffReporter.INSTANCE, - AraxisMergeReporter.INSTANCE, - P4MergeReporter.INSTANCE, - WinMergeReporter.INSTANCE, - KDiff3Reporter.INSTANCE, - VisualStudioReporter.INSTANCE, - RiderReporter.INSTANCE, - FrameworkAssertReporter.INSTANCE, - QuietReporter.INSTANCE - ) - { - } -} -``` -snippet source | anchor +snippet source | anchor You can also override the default order while using `DiffReporter` by defining `DiffEngine_ToolOrder` environment variable. The value of that variable should contain a delimiter (`,`, `|`, ` `) separated list of the diff tool names in the desired order. More details about that in [Diff Tool Order](https://github.com/VerifyTests/DiffEngine/blob/main/docs/diff-tool.order.md) diff --git a/src/ApprovalTests.NUnit3/GlobalUsings.cs b/src/ApprovalTests.NUnit3/GlobalUsings.cs index 42300ac5..3369c9a1 100644 --- a/src/ApprovalTests.NUnit3/GlobalUsings.cs +++ b/src/ApprovalTests.NUnit3/GlobalUsings.cs @@ -1,26 +1,3 @@ -global using System.Diagnostics; -global using System.Globalization; -global using System.Net; -global using System.Runtime.CompilerServices; -global using ApprovalTests; -global using ApprovalTests.Approvers; -global using ApprovalTests.Combinations; -global using ApprovalTests.Core; -global using ApprovalTests.Core.Exceptions; -global using ApprovalTests.Email; -global using ApprovalTests.Events; -global using ApprovalTests.ExceptionalExceptions; -global using ApprovalTests.Maintenance; -global using ApprovalTests.Namers; -global using ApprovalTests.Namers.StackTraceParsers; +global using ApprovalTests; global using ApprovalTests.Reporters; -global using ApprovalTests.Scrubber; -global using ApprovalTests.Utilities; -global using ApprovalTests.WindowsRegistry; -global using ApprovalUtilities.Persistence; -global using ApprovalUtilities.SimpleLogger; -global using ApprovalUtilities.Utilities; -global using iText.Kernel.Pdf; -global using iText.Layout; -global using iText.Layout.Element; global using NUnit.Framework; \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/AssemblyLevelTest.cs b/src/ApprovalTests.NUnit3/Reporters/AssemblyLevelTest.cs deleted file mode 100644 index cedfd3cf..00000000 --- a/src/ApprovalTests.NUnit3/Reporters/AssemblyLevelTest.cs +++ /dev/null @@ -1,12 +0,0 @@ -[TestFixture] -public class AssemblyLevelTest -{ - [Test] - public void TestClassLevel() - { - using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) - { - Assert.AreEqual(typeof(DiffReporter), Approvals.GetReporter().GetType()); - } - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/CustomDiffReporter.cs b/src/ApprovalTests.NUnit3/Reporters/CustomDiffReporter.cs deleted file mode 100644 index 06a15c0f..00000000 --- a/src/ApprovalTests.NUnit3/Reporters/CustomDiffReporter.cs +++ /dev/null @@ -1,22 +0,0 @@ -using ApprovalTests.Reporters.TestFrameworks; - -public class CustomDiffReporter : - FirstWorkingReporter -{ - public CustomDiffReporter() - : base( - //TODO: re-order or remove as required - BeyondCompareReporter.INSTANCE, - TortoiseDiffReporter.INSTANCE, - AraxisMergeReporter.INSTANCE, - P4MergeReporter.INSTANCE, - WinMergeReporter.INSTANCE, - KDiff3Reporter.INSTANCE, - VisualStudioReporter.INSTANCE, - RiderReporter.INSTANCE, - FrameworkAssertReporter.INSTANCE, - QuietReporter.INSTANCE - ) - { - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/FirstWorkingReporterTest.TestException.approved.txt b/src/ApprovalTests.NUnit3/Reporters/FirstWorkingReporterTest.TestException.approved.txt deleted file mode 100644 index 19a76f13..00000000 --- a/src/ApprovalTests.NUnit3/Reporters/FirstWorkingReporterTest.TestException.approved.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/FirstWorkingReporterTest.cs b/src/ApprovalTests.NUnit3/Reporters/FirstWorkingReporterTest.cs deleted file mode 100644 index 231424f2..00000000 --- a/src/ApprovalTests.NUnit3/Reporters/FirstWorkingReporterTest.cs +++ /dev/null @@ -1,72 +0,0 @@ -[TestFixture] -public class FirstWorkingReporterTest -{ - [Test] - public void TestCallsFirstAndOnlyFirst() - { - var a = new RecordingReporter(false); - var b = new RecordingReporter(true); - var c = new RecordingReporter(true); - - var reporter = new FirstWorkingReporter(a, b, c); - Assert.IsTrue(reporter.IsWorkingInThisEnvironment("default.txt")); - reporter.Report("a", "b"); - Assert.IsNull(a.CalledWith); - Assert.AreEqual("a,b", b.CalledWith); - Assert.IsNull(c.CalledWith); - } - - [Test] - public void TestException() - { - if (DiffEngine.BuildServerDetector.Detected) - { - // DiffReporter not detected on CI - return; - } - File.Create("received.notreal").Close(); - try - { - var ex = ExceptionUtilities.GetException(() => new DiffReporter().Report("received.notreal", "received.notreal")); - Assert.AreEqual("Could not find a diff tool for extension: .notreal", ex.Message); - } - finally - { - File.Delete("received.notreal"); - } - } - - [Test] - public void TestCleanup() - { - var cleanup1 = new MockCleanup(); - var cleanup2 = new MockCleanup(); - var r = new FirstWorkingReporter(cleanup1, new QuietReporter(), cleanup2); - r.CleanUp("a", "r"); - Assert.AreEqual("a", cleanup1.approved); - Assert.AreEqual("a", cleanup2.approved); - Assert.AreEqual("r", cleanup1.received); - Assert.AreEqual("r", cleanup2.received); - } -} - -public class MockCleanup : IEnvironmentAwareReporter, IApprovalReporterWithCleanUp -{ - public string approved; - public string received; - - public void Report(string approved, string received) - { - } - - public bool IsWorkingInThisEnvironment(string forFile) - { - return false; - } - - public void CleanUp(string approved, string received) - { - this.approved = approved; - this.received = received; - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/InlineTextReporterTest.CSharpStrings.approved.txt b/src/ApprovalTests.NUnit3/Reporters/InlineTextReporterTest.CSharpStrings.approved.txt deleted file mode 100644 index de9443f2..00000000 --- a/src/ApprovalTests.NUnit3/Reporters/InlineTextReporterTest.CSharpStrings.approved.txt +++ /dev/null @@ -1,9 +0,0 @@ -C# Strings - -var expected = "boo"; -var expected = "with \"quotes\"."; - var expected = new[]{ - "**************", - "I am ten chars", - "**************", - }; diff --git a/src/ApprovalTests.NUnit3/Reporters/InlineTextReporterTest.cs b/src/ApprovalTests.NUnit3/Reporters/InlineTextReporterTest.cs deleted file mode 100644 index 337db344..00000000 --- a/src/ApprovalTests.NUnit3/Reporters/InlineTextReporterTest.cs +++ /dev/null @@ -1,64 +0,0 @@ -[TestFixture] -public class InlineTextReporterTest -{ - [Test] - public void TestComment() - { - var actual = "Hello"; - var expected = "Hello"; - Approvals.AssertText(expected, actual); - } - - [Test] - public void CSharpStrings() - { - var example1 = new[] - { - "**************", - - "I am ten chars", - "**************", - }; - var samples = new[] { "boo","with \"quotes\".", example1.JoinWith("\n"), }; - - Approvals.VerifyAll("C# Strings", samples, InlineTextReporter.ConvertToCSharp); - } - - [Test] - public void MakerHeadertest() - { - // begin-snippet: assert_text - var header = new Header(); - var actual = header.MakeHeading("I am ten chars"); - var expected = new[]{ - "**************", - "I am ten chars", - "**************", - - }; - Approvals.AssertText(expected, actual); - // end-snippet - } - - public void MakerHeaderBefore() - { - // begin-snippet: assert_text_before - var header = new Header(); - var actual = header.MakeHeading("I am ten chars"); - var expected = ""; - Approvals.AssertText(expected, actual); - // end-snippet - } -} - -public class Header -{ - public string MakeHeading(string iAmTenChars) => - new[] - { - "**************", - - "I am ten chars", - "**************", - }.JoinWith("\n"); -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/IntroductionReporterTest.TestComment.approved.txt b/src/ApprovalTests.NUnit3/Reporters/IntroductionReporterTest.TestComment.approved.txt deleted file mode 100644 index 17d34576..00000000 --- a/src/ApprovalTests.NUnit3/Reporters/IntroductionReporterTest.TestComment.approved.txt +++ /dev/null @@ -1,31 +0,0 @@ -Welcome to ApprovalTests. -==== - -Please add: - -``` -[UseReporter(typeof(DiffReporter))] -``` - -to your class, test method or assembly. - -Why: ----- - -ApprovalTests uses the `[UseReporter]` attribute from your test class, method or assembly. When you do this ApprovalTest will launch the result using that reporter, for example in your diff tool. - -You can find several reporters in `ApprovalTests.Reporters` namespace, or create your own by extending the `ApprovalTests.Core.IApprovalFailureReporter` interface. - -Find more at: http://blog.approvaltests.com/2011/12/using-reporters-in-approval-tests.html - -Best Practice: ----- - -Add an *assembly* level configuration. Create a file in your base directory with the name `ApprovalTestsConfig.cs`, and the contents: - -``` -using ApprovalTests.Reporters; - -[assembly: UseReporter(typeof(DiffReporter))] -``` - diff --git a/src/ApprovalTests.NUnit3/Reporters/IntroductionReporterTest.cs b/src/ApprovalTests.NUnit3/Reporters/IntroductionReporterTest.cs deleted file mode 100644 index 7ad4fc37..00000000 --- a/src/ApprovalTests.NUnit3/Reporters/IntroductionReporterTest.cs +++ /dev/null @@ -1,7 +0,0 @@ -[TestFixture] -public class IntroductionReporterTest -{ - [Test] - public void TestComment() => - Approvals.Verify(new IntroductionReporter().GetFriendlyWelcomeMessage()); -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/MultiReporterTest.cs b/src/ApprovalTests.NUnit3/Reporters/MultiReporterTest.cs deleted file mode 100644 index c5f11da7..00000000 --- a/src/ApprovalTests.NUnit3/Reporters/MultiReporterTest.cs +++ /dev/null @@ -1,27 +0,0 @@ -using ApprovalTests.Reporters.TestFrameworks; - -[TestFixture] -public class MultiReporterTest -{ - [Test] - public void TestMultiReporter() - { - var a = new RecordingReporter(); - var b = new RecordingReporter(); - var multi = new MultiReporter(a, b); - multi.Report("a", "r"); - Assert.AreEqual("a,r", a.CalledWith); - Assert.AreEqual("a,r", b.CalledWith); - } - - [Test] - public void TestCallAfterException() - { - var a = new NUnitReporter(); - var b = new RecordingReporter(); - var multi = new MultiReporter(a, b); - var exception = ExceptionUtilities.GetException(() => multi.Report("a", "r")); - Assert.AreEqual("a,r", b.CalledWith); - Assert.IsInstanceOf(exception); - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/PowerShellClipboardReporterTest.TestCommand.approved.txt b/src/ApprovalTests.NUnit3/Reporters/PowerShellClipboardReporterTest.TestCommand.approved.txt deleted file mode 100644 index cac24d5e..00000000 --- a/src/ApprovalTests.NUnit3/Reporters/PowerShellClipboardReporterTest.TestCommand.approved.txt +++ /dev/null @@ -1 +0,0 @@ -Move-Item "c:\temp\recieved.txt" "c:\temp\approved.txt" -Force \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/PowerShellClipboardReporterTest.cs b/src/ApprovalTests.NUnit3/Reporters/PowerShellClipboardReporterTest.cs deleted file mode 100644 index 11e0c13c..00000000 --- a/src/ApprovalTests.NUnit3/Reporters/PowerShellClipboardReporterTest.cs +++ /dev/null @@ -1,7 +0,0 @@ -[TestFixture] -public class PowerShellClipboardReporterTest -{ - [Test] - public void TestCommand() => - Approvals.Verify(PowerShellClipboardReporter.GetCommandLineForApproval(@"c:\temp\approved.txt", @"c:\temp\recieved.txt")); -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/RecordingReporter.cs b/src/ApprovalTests.NUnit3/Reporters/RecordingReporter.cs deleted file mode 100644 index 513cb5e5..00000000 --- a/src/ApprovalTests.NUnit3/Reporters/RecordingReporter.cs +++ /dev/null @@ -1,18 +0,0 @@ -public class RecordingReporter : IEnvironmentAwareReporter -{ - readonly bool working; - - public RecordingReporter() => - working = true; - - public RecordingReporter(bool working) => - this.working = working; - - public void Report(string approved, string received) => - CalledWith = $"{approved},{received}"; - - public bool IsWorkingInThisEnvironment(string forFile) => - working; - - public string CalledWith { get; set; } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/ReporterFactoryTest.cs b/src/ApprovalTests.NUnit3/Reporters/ReporterFactoryTest.cs deleted file mode 100644 index 292fc9ed..00000000 --- a/src/ApprovalTests.NUnit3/Reporters/ReporterFactoryTest.cs +++ /dev/null @@ -1,89 +0,0 @@ -[TestFixture] -[UseReporter(typeof(ClassLevelReporter))] -public class ReporterFactoryTest -{ - static IEnumerable GetSingletonReporterTypes() - { - var types = typeof(UseReporterAttribute).Assembly.GetTypes(); - var reporters = types.Where(r => r.GetInterfaces().Contains(typeof(IApprovalFailureReporter))); - var singletons = reporters.Where(r => r.GetConstructor(Type.EmptyTypes) != null); - return singletons; - } - - static void SubMethod() => - Assert.AreEqual(typeof(MethodLevelReporter), Approvals.GetReporter().GetType()); - - [Test] - public void TestClassLevel() - { - using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) - { - Assert.AreEqual(typeof(ClassLevelReporter), Approvals.GetReporter().GetType()); - } - } - - [Test] - [UseReporter(typeof(MethodLevelReporter))] - public void TestMethodOverride() - { - using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) - { - Assert.AreEqual(typeof(MethodLevelReporter), Approvals.GetReporter().GetType()); - } - } - - [Test] - [UseReporter(typeof(MethodLevelReporter))] - public async Task TestAsyncMethodOverride() - { - await Task.Delay(1); - using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) - { - Assert.AreEqual(typeof(MethodLevelReporter), Approvals.GetReporter().GetType()); - } - } - - [Test] - [UseReporter(typeof(MethodLevelReporter))] - public void TestMethodOverrideWithSubMethod() - { - using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) - { - SubMethod(); - } - } - - [Test] - [UseReporter(typeof(MethodLevelReporter), typeof(ClassLevelReporter))] - public void TestMultipleReporters() - { - using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) - { - Assert.AreEqual(typeof(MultiReporter), Approvals.GetReporter().GetType()); - } - } - - [Test] - public void TestSingletonOnAllReporters() - { - using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) - { - var reporters = GetSingletonReporterTypes(); - foreach (var r in reporters) Assert.IsInstanceOf(r, UseReporterAttribute.GetSingleton(r), $"Please add\npublic static readonly {r.FullName} INSTANCE = new {r.FullName}();"); - } - } -} - -public class MethodLevelReporter : IApprovalFailureReporter -{ - public void Report(string approved, string received) - { - } -} - -public class ClassLevelReporter : IApprovalFailureReporter -{ - public void Report(string approved, string received) - { - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/ReporterTest.TestInvalidReporterShouldThrow.approved.txt b/src/ApprovalTests.NUnit3/Reporters/ReporterTest.TestInvalidReporterShouldThrow.approved.txt deleted file mode 100644 index 9f714c4b..00000000 --- a/src/ApprovalTests.NUnit3/Reporters/ReporterTest.TestInvalidReporterShouldThrow.approved.txt +++ /dev/null @@ -1,9 +0,0 @@ -Invalid configuration of reporter. Reporters must extend IApprovalFailureReporter. -Invalid reporter type: ReporterTest - -Note: The stack here is not helpful. - -Invalid configuration of reporter. Reporters must extend IApprovalFailureReporter. -Invalid reporter type: ReporterTest - -Note: The stack here is not helpful. \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/ReporterTest.TestMultipleWithInvalidReporterShouldThrow.approved.txt b/src/ApprovalTests.NUnit3/Reporters/ReporterTest.TestMultipleWithInvalidReporterShouldThrow.approved.txt deleted file mode 100644 index a674b84b..00000000 --- a/src/ApprovalTests.NUnit3/Reporters/ReporterTest.TestMultipleWithInvalidReporterShouldThrow.approved.txt +++ /dev/null @@ -1,9 +0,0 @@ -Invalid configuration of reporter. Reporters must extend IApprovalFailureReporter. -Invalid reporter type: System.String - -Note: The stack here is not helpful. - -Invalid configuration of reporter. Reporters must extend IApprovalFailureReporter. -Invalid reporter type: ReporterTest - -Note: The stack here is not helpful. \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/ReporterTest.cs b/src/ApprovalTests.NUnit3/Reporters/ReporterTest.cs deleted file mode 100644 index 8a904211..00000000 --- a/src/ApprovalTests.NUnit3/Reporters/ReporterTest.cs +++ /dev/null @@ -1,41 +0,0 @@ -using ApprovalTests.Reporters.ContinuousIntegration; - -[TestFixture] -public class ReporterTest -{ - [Test] - public void Testname() - { - var old = Environment.GetEnvironmentVariable(NCrunchReporter.EnvironmentVariable); - Environment.SetEnvironmentVariable(NCrunchReporter.EnvironmentVariable, "1"); - Assert.IsTrue(NCrunchReporter.INSTANCE.IsWorkingInThisEnvironment("a.txt")); - Environment.SetEnvironmentVariable(NCrunchReporter.EnvironmentVariable, old); - } - - [Test] - public void TestInvalidReporterShouldThrow() - { - var attribute = new UseReporterAttribute(typeof(ReporterTest)); - VerifyReporterAttribute(attribute); - } - - [Test] - public void TestMultipleWithInvalidReporterShouldThrow() - { - var attribute = new UseReporterAttribute(typeof(ReporterTest), typeof(string)); - VerifyReporterAttribute(attribute); - } - - static void VerifyReporterAttribute(UseReporterAttribute attribute) - { - var reporter = (IEnvironmentAwareReporter) attribute.Reporter; - var reportException = Assert.Throws(() => reporter.Report("a.txt", "a.txt")); - var isWorkingException = Assert.Throws(() => reporter.IsWorkingInThisEnvironment("a.txt")); - - Approvals.Verify($""" - {reportException.Message} - - {isWorkingException.Message} - """); - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/Reporters/TortoiseImageDiffTest.TestIsImage.approved.txt b/src/ApprovalTests.NUnit3/Reporters/TortoiseImageDiffTest.TestIsImage.approved.txt deleted file mode 100644 index 94de06af..00000000 --- a/src/ApprovalTests.NUnit3/Reporters/TortoiseImageDiffTest.TestIsImage.approved.txt +++ /dev/null @@ -1,9 +0,0 @@ -image.png => True -image.gif => True -image.jpg => True -image.jpeg => True -image.tif => True -image.tiff => True -movie.avi => False -text.txt => False -excel.xls => False diff --git a/src/ApprovalTests.NUnit3/Reporters/TortoiseImageDiffTest.cs b/src/ApprovalTests.NUnit3/Reporters/TortoiseImageDiffTest.cs deleted file mode 100644 index 47901885..00000000 --- a/src/ApprovalTests.NUnit3/Reporters/TortoiseImageDiffTest.cs +++ /dev/null @@ -1,21 +0,0 @@ -[TestFixture] -public class TortoiseImageDiffTest -{ - [Test] - public void TestIsImage() - { - if (!TortoiseTextDiffReporter.INSTANCE.IsWorkingInThisEnvironment("a.txt")) - { - return; - } - - var files = new[] - { - "image.png", "image.gif", "image.jpg", "image.jpeg", "image.tif", "image.tiff", - "movie.avi", "text.txt", "excel.xls" - }; - Approvals.VerifyAll( - files, - f => $"{f} => {TortoiseImageDiffReporter.INSTANCE.IsWorkingInThisEnvironment(f)}"); - } -} \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/UnixLineEndings.txt b/src/ApprovalTests.NUnit3/UnixLineEndings.txt deleted file mode 100644 index bab18e64..00000000 --- a/src/ApprovalTests.NUnit3/UnixLineEndings.txt +++ /dev/null @@ -1,2 +0,0 @@ -Foo -Bar \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/WindowsLineEndings.txt b/src/ApprovalTests.NUnit3/WindowsLineEndings.txt deleted file mode 100644 index bab18e64..00000000 --- a/src/ApprovalTests.NUnit3/WindowsLineEndings.txt +++ /dev/null @@ -1,2 +0,0 @@ -Foo -Bar \ No newline at end of file From ba74b08101b338beb6cb31c6ce62909a90d83d1b Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 11 May 2024 17:29:47 +1000 Subject: [PATCH 05/12] . --- src/ApprovalTests.NUnit3/GlobalUsings.cs | 4 +++- src/ApprovalTests.NUnit3/NUnitReporterTest.cs | 3 --- src/ApprovalTests.NUnit3/NUnitReporterWithCleanup.cs | 2 -- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/ApprovalTests.NUnit3/GlobalUsings.cs b/src/ApprovalTests.NUnit3/GlobalUsings.cs index 3369c9a1..7704c5d8 100644 --- a/src/ApprovalTests.NUnit3/GlobalUsings.cs +++ b/src/ApprovalTests.NUnit3/GlobalUsings.cs @@ -1,3 +1,5 @@ global using ApprovalTests; global using ApprovalTests.Reporters; -global using NUnit.Framework; \ No newline at end of file +global using ApprovalTests.Reporters.TestFrameworks; +global using NUnit.Framework; +global using NUnit.Framework.Internal; \ No newline at end of file diff --git a/src/ApprovalTests.NUnit3/NUnitReporterTest.cs b/src/ApprovalTests.NUnit3/NUnitReporterTest.cs index be1f1f20..48f91335 100644 --- a/src/ApprovalTests.NUnit3/NUnitReporterTest.cs +++ b/src/ApprovalTests.NUnit3/NUnitReporterTest.cs @@ -1,6 +1,3 @@ -using ApprovalTests.Reporters.TestFrameworks; -using NUnit.Framework.Internal; - [TestFixture] public class NUnitReporterTest { diff --git a/src/ApprovalTests.NUnit3/NUnitReporterWithCleanup.cs b/src/ApprovalTests.NUnit3/NUnitReporterWithCleanup.cs index 1d684642..5f9ef4aa 100644 --- a/src/ApprovalTests.NUnit3/NUnitReporterWithCleanup.cs +++ b/src/ApprovalTests.NUnit3/NUnitReporterWithCleanup.cs @@ -1,5 +1,3 @@ -using ApprovalTests.Reporters.TestFrameworks; - public class NUnitReporterWithCleanup : NUnitReporter { public override void Report(string approved, string received) From 4899272cc779a5f2145907f6e5028d13e0059ddb Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 11 May 2024 17:37:24 +1000 Subject: [PATCH 06/12] Update ApprovalTests.NUnit3.csproj --- .../ApprovalTests.NUnit3.csproj | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/ApprovalTests.NUnit3/ApprovalTests.NUnit3.csproj b/src/ApprovalTests.NUnit3/ApprovalTests.NUnit3.csproj index 645b6a2e..e44696ee 100644 --- a/src/ApprovalTests.NUnit3/ApprovalTests.NUnit3.csproj +++ b/src/ApprovalTests.NUnit3/ApprovalTests.NUnit3.csproj @@ -6,24 +6,11 @@ - - - - - - - - - - .cs - NUnitReporterTest - NUnitReporterTest.cs - From cde06f2ec3b51776a07097f875a4a6de68b77d22 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 11 May 2024 17:44:43 +1000 Subject: [PATCH 07/12] Update StackTraceParserTests.cs --- .../Namer/StackTraceParsers/StackTraceParserTests.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/ApprovalTests.Tests/Namer/StackTraceParsers/StackTraceParserTests.cs b/src/ApprovalTests.Tests/Namer/StackTraceParsers/StackTraceParserTests.cs index b864d5c0..fd55fa32 100644 --- a/src/ApprovalTests.Tests/Namer/StackTraceParsers/StackTraceParserTests.cs +++ b/src/ApprovalTests.Tests/Namer/StackTraceParsers/StackTraceParserTests.cs @@ -26,13 +26,7 @@ public void Parse_UsingStaticInitialize_DontThrowInvalidOperationException() } catch (InvalidOperationException e) { - Assert.Fail( - "InvalidOperationException when trying to parse stacktrace. " + - "This is caused by the parser collection not being thread-safe. " + - "Original exception message : {0} and stacktrace : {1}", - e.Message, - e.StackTrace - ); + Assert.Fail($"InvalidOperationException when trying to parse stacktrace. This is caused by the parser collection not being thread-safe. Original exception message : {e.Message} and stacktrace : {e.StackTrace}"); } // Because the current stacktrace passed to the parse method doesn't contains any trace of a compliant stacktrace parser // it's normal that we receive an exception here so let's ignore it. From 2f52ab2a1e0180bc2270e7c58e8417443ef2d1ae Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 11 May 2024 18:19:47 +1000 Subject: [PATCH 08/12] . --- src/ApprovalTests.NUnit3/NUnitReporterTest.cs | 2 +- .../NUnitReporterWithCleanup.cs | 2 +- .../ApprovalTests.Tests.csproj | 2 +- src/ApprovalTests.Tests/FileApproverTests.cs | 6 +++--- src/ApprovalTests.Tests/GlobalUsings.cs | 3 ++- .../Namer/AdditionalInformationTests.cs | 14 +++++++------- .../Namer/ApprovalResultsTest.cs | 2 +- .../Namer/ApprovalsFilenameTest.cs | 2 +- .../Namer/NunitStackTraceNamerTests.cs | 8 ++++---- src/ApprovalTests.Tests/Pdf/PdfTest.cs | 8 ++++---- .../Persistence/AsyncSaverTest.cs | 6 +++--- .../Reporters/AssemblyLevelTest.cs | 2 +- .../Reporters/FirstWorkingReporterTest.cs | 18 +++++++++--------- .../Reporters/MultiReporterTest.cs | 10 +++++----- .../Reporters/NUnitReporterTest.cs | 8 +++----- .../Reporters/NUnitReporterWithCleanup.cs | 2 +- .../Reporters/ReporterFactoryTest.cs | 15 +++++++++------ .../Reporters/ReporterTest.cs | 2 +- .../StackTraceScrubberTest.cs | 6 +++--- .../Writers/WriterFactoryTests.cs | 8 ++++---- .../NonNUnitReporterTest.cs | 2 +- .../TestFrameworks/FrameworkAssertReporter.cs | 3 ++- .../{NUnitReporter.cs => NUnit3Reporter.cs} | 6 +++--- .../Reporters/TestFrameworks/NUnit4Reporter.cs | 11 +++++++++++ 24 files changed, 81 insertions(+), 67 deletions(-) rename src/ApprovalTests/Reporters/TestFrameworks/{NUnitReporter.cs => NUnit3Reporter.cs} (56%) create mode 100644 src/ApprovalTests/Reporters/TestFrameworks/NUnit4Reporter.cs diff --git a/src/ApprovalTests.NUnit3/NUnitReporterTest.cs b/src/ApprovalTests.NUnit3/NUnitReporterTest.cs index 48f91335..c9b57630 100644 --- a/src/ApprovalTests.NUnit3/NUnitReporterTest.cs +++ b/src/ApprovalTests.NUnit3/NUnitReporterTest.cs @@ -5,7 +5,7 @@ public class NUnitReporterTest public void TestNunitIsWorking() { Approvals.SetCaller(); - Assert.IsTrue(NUnitReporter.INSTANCE.IsWorkingInThisEnvironment("default.txt")); + Assert.IsTrue(NUnit3Reporter.INSTANCE.IsWorkingInThisEnvironment("default.txt")); } [Test] diff --git a/src/ApprovalTests.NUnit3/NUnitReporterWithCleanup.cs b/src/ApprovalTests.NUnit3/NUnitReporterWithCleanup.cs index 5f9ef4aa..5be9f64a 100644 --- a/src/ApprovalTests.NUnit3/NUnitReporterWithCleanup.cs +++ b/src/ApprovalTests.NUnit3/NUnitReporterWithCleanup.cs @@ -1,4 +1,4 @@ -public class NUnitReporterWithCleanup : NUnitReporter +public class NUnitReporterWithCleanup : NUnit3Reporter { public override void Report(string approved, string received) { diff --git a/src/ApprovalTests.Tests/ApprovalTests.Tests.csproj b/src/ApprovalTests.Tests/ApprovalTests.Tests.csproj index aa292a46..1fbed8a9 100644 --- a/src/ApprovalTests.Tests/ApprovalTests.Tests.csproj +++ b/src/ApprovalTests.Tests/ApprovalTests.Tests.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/ApprovalTests.Tests/FileApproverTests.cs b/src/ApprovalTests.Tests/FileApproverTests.cs index 097ce01a..3ac276af 100644 --- a/src/ApprovalTests.Tests/FileApproverTests.cs +++ b/src/ApprovalTests.Tests/FileApproverTests.cs @@ -22,7 +22,7 @@ public void LineEndingsAreIgnored() File.WriteAllText(approvedFile, "Foo\nBar"); File.WriteAllText(receivedFile, "Foo\r\nBar"); var fileApprover = new FileApprover(null, null, true).Approve(approvedFile, receivedFile); - Assert.IsNull(fileApprover); + ClassicAssert.IsNull(fileApprover); } [Test] @@ -34,13 +34,13 @@ public void LineEndingAreNotIgnored() File.WriteAllText(approvedFile, "Foo\nBar"); File.WriteAllText(receivedFile, "Foo\r\nBar"); var fileApprover = new FileApprover(null, null).Approve(approvedFile, receivedFile); - Assert.IsInstanceOf(fileApprover); + ClassicAssert.IsInstanceOf(fileApprover); } static void AssertApprover(string receivedFile, string approvedFile, bool expected) { var basePath = PathUtilities.GetDirectoryForCaller(); var fileApprover = new FileApprover(null, null).Approve(basePath + approvedFile, basePath + receivedFile); - Assert.AreEqual(expected, fileApprover == null); + ClassicAssert.AreEqual(expected, fileApprover == null); } } \ No newline at end of file diff --git a/src/ApprovalTests.Tests/GlobalUsings.cs b/src/ApprovalTests.Tests/GlobalUsings.cs index 53518803..7cd0e6a6 100644 --- a/src/ApprovalTests.Tests/GlobalUsings.cs +++ b/src/ApprovalTests.Tests/GlobalUsings.cs @@ -24,4 +24,5 @@ global using iText.Kernel.Pdf; global using iText.Layout; global using iText.Layout.Element; -global using NUnit.Framework; \ No newline at end of file +global using NUnit.Framework; +global using NUnit.Framework.Legacy; \ No newline at end of file diff --git a/src/ApprovalTests.Tests/Namer/AdditionalInformationTests.cs b/src/ApprovalTests.Tests/Namer/AdditionalInformationTests.cs index f4d65d82..5a4a24f8 100644 --- a/src/ApprovalTests.Tests/Namer/AdditionalInformationTests.cs +++ b/src/ApprovalTests.Tests/Namer/AdditionalInformationTests.cs @@ -23,7 +23,7 @@ public void UniqueForRuntime() public void WithoutExtraInfo() { var name = Approvals.GetDefaultNamer().Name; - Assert.AreEqual("AdditionalInformationTests.WithoutExtraInfo", name); + ClassicAssert.AreEqual("AdditionalInformationTests.WithoutExtraInfo", name); } [Test] @@ -32,7 +32,7 @@ public void WithScenarioData() using (ApprovalResults.ForScenario("ScenarioName")) { var name = Approvals.GetDefaultNamer().Name; - Assert.AreEqual("AdditionalInformationTests.WithScenarioData.ForScenario.ScenarioName", name); + ClassicAssert.AreEqual("AdditionalInformationTests.WithScenarioData.ForScenario.ScenarioName", name); } } @@ -43,7 +43,7 @@ public async Task WithScenarioDataAsync() { await Task.Delay(10); var name = Approvals.GetDefaultNamer().Name; - Assert.AreEqual("AdditionalInformationTests.WithScenarioDataAsync.ForScenario.asyncScenario", name); + ClassicAssert.AreEqual("AdditionalInformationTests.WithScenarioDataAsync.ForScenario.asyncScenario", name); } } @@ -54,7 +54,7 @@ public void WithScenarioDataScrubsInvalidChars() using (ApprovalResults.ForScenario("invalid/chars")) { var name = Approvals.GetDefaultNamer().Name; - Assert.AreEqual( + ClassicAssert.AreEqual( "AdditionalInformationTests.WithScenarioDataScrubsInvalidChars.ForScenario.invalid_chars", name); } } @@ -66,7 +66,7 @@ public void WithMultiplePartScenarioData(string a, string b) using (ApprovalResults.ForScenario(a, b)) { var name = Approvals.GetDefaultNamer().Name; - Assert.AreEqual("AdditionalInformationTests.WithMultiplePartScenarioData.ForScenario.foo.bar", name); + ClassicAssert.AreEqual("AdditionalInformationTests.WithMultiplePartScenarioData.ForScenario.foo.bar", name); } } @@ -78,7 +78,7 @@ public void TestMultipleNames() using (ApprovalResults.ForScenario("machineName")) { var name = Approvals.GetDefaultNamer().Name; - Assert.AreEqual(name, + ClassicAssert.AreEqual(name, "AdditionalInformationTests.TestMultipleNames.ForScenario.scenario.ForScenario.machineName"); } } @@ -91,7 +91,7 @@ public class NestedClassTests public void WithNestedClass() { var name = Approvals.GetDefaultNamer().Name; - Assert.AreEqual("AdditionalInformationTests.NestedClassTests.WithNestedClass", name); + ClassicAssert.AreEqual("AdditionalInformationTests.NestedClassTests.WithNestedClass", name); } } } \ No newline at end of file diff --git a/src/ApprovalTests.Tests/Namer/ApprovalResultsTest.cs b/src/ApprovalTests.Tests/Namer/ApprovalResultsTest.cs index f6074ac1..7913ddb8 100644 --- a/src/ApprovalTests.Tests/Namer/ApprovalResultsTest.cs +++ b/src/ApprovalTests.Tests/Namer/ApprovalResultsTest.cs @@ -28,7 +28,7 @@ public void TestUniqueNames() [Test] public void TestEasyNames() => - Assert.AreEqual("Windows 7", ApprovalResults.TransformEasyOsName("Microsoft Windows 7 Professional N")); + ClassicAssert.AreEqual("Windows 7", ApprovalResults.TransformEasyOsName("Microsoft Windows 7 Professional N")); public void SampleUniqueForOs() { diff --git a/src/ApprovalTests.Tests/Namer/ApprovalsFilenameTest.cs b/src/ApprovalTests.Tests/Namer/ApprovalsFilenameTest.cs index 3a4b6cdd..4cae9152 100644 --- a/src/ApprovalTests.Tests/Namer/ApprovalsFilenameTest.cs +++ b/src/ApprovalTests.Tests/Namer/ApprovalsFilenameTest.cs @@ -7,7 +7,7 @@ public void TestMachineSpecificName() var approvalsFilename = ApprovalsFilename.Parse(@"..\Email\EmailTest.Testname.Microsoft_Windows_10_Education.approved.eml"); // end-snippet Approvals.Verify(approvalsFilename); - Assert.True(approvalsFilename.IsMachineSpecific); + ClassicAssert.True(approvalsFilename.IsMachineSpecific); } [Test] diff --git a/src/ApprovalTests.Tests/Namer/NunitStackTraceNamerTests.cs b/src/ApprovalTests.Tests/Namer/NunitStackTraceNamerTests.cs index a954ea17..f4e5096d 100644 --- a/src/ApprovalTests.Tests/Namer/NunitStackTraceNamerTests.cs +++ b/src/ApprovalTests.Tests/Namer/NunitStackTraceNamerTests.cs @@ -5,16 +5,16 @@ public class NunitStackTraceNamerTests public void TestApprovalName() { var name = new UnitTestFrameworkNamer().Name; - Assert.AreEqual("NunitStackTraceNamerTests.TestApprovalName", name); + ClassicAssert.AreEqual("NunitStackTraceNamerTests.TestApprovalName", name); } [Test] public void TestSourcePath() { var path = Approvals.GetDefaultNamer().SourcePath; - Assert.IsNotEmpty(path); + ClassicAssert.IsNotEmpty(path); var fullPath = path.ToLower() + Path.DirectorySeparatorChar + GetType().Name + ".cs"; - Assert.IsTrue(File.Exists(fullPath), fullPath + " does not exist"); + ClassicAssert.IsTrue(File.Exists(fullPath), fullPath + " does not exist"); } [Test] @@ -25,6 +25,6 @@ public void TestCaseAttributes(string caseName) { NamerFactory.AdditionalInformation = caseName; var name = new UnitTestFrameworkNamer().Name; - Assert.AreEqual("NunitStackTraceNamerTests.TestCaseAttributes." + caseName, name); + ClassicAssert.AreEqual("NunitStackTraceNamerTests.TestCaseAttributes." + caseName, name); } } \ No newline at end of file diff --git a/src/ApprovalTests.Tests/Pdf/PdfTest.cs b/src/ApprovalTests.Tests/Pdf/PdfTest.cs index 655f5385..8bbd8c5a 100644 --- a/src/ApprovalTests.Tests/Pdf/PdfTest.cs +++ b/src/ApprovalTests.Tests/Pdf/PdfTest.cs @@ -22,9 +22,9 @@ arbitrary content public void TestPdf_ScrubberIdsMatch(string input) { var matchPositions = PdfScrubber.FindIds(input).ToList(); - Assert.AreEqual(2, matchPositions.Count); + ClassicAssert.AreEqual(2, matchPositions.Count); - Assert.IsTrue(matchPositions.All(pos => input[pos.start - 1] == '<' && input[pos.start + pos.length] == '>')); + ClassicAssert.IsTrue(matchPositions.All(pos => input[pos.start - 1] == '<' && input[pos.start + pos.length] == '>')); } [TestCase(""" @@ -46,7 +46,7 @@ NO IDS DECLARED public void TestPdf_ScrubberIdsNotMatch(string input) { var matchPositions = PdfScrubber.FindIds(input).ToList(); - Assert.AreEqual(0, matchPositions.Count); + ClassicAssert.AreEqual(0, matchPositions.Count); } [Test] @@ -128,6 +128,6 @@ public void TestPdf_ScrubberFindAllReplacementsInFile() using var fileStream = File.OpenRead(pdf); var matches = PdfScrubber.FindReplacements(fileStream); - Assert.AreEqual(3, matches.Count()); + ClassicAssert.AreEqual(3, matches.Count()); } } \ No newline at end of file diff --git a/src/ApprovalTests.Tests/Persistence/AsyncSaverTest.cs b/src/ApprovalTests.Tests/Persistence/AsyncSaverTest.cs index 7e2fea3e..61fc81f2 100644 --- a/src/ApprovalTests.Tests/Persistence/AsyncSaverTest.cs +++ b/src/ApprovalTests.Tests/Persistence/AsyncSaverTest.cs @@ -6,7 +6,7 @@ public void TestAsyncWrapperSave() { using var f = new TempFile("stuff"); var s = new FileSaver(f.File); - Assert.AreEqual("hello", s.ToAsync().Save("hello").Result); + ClassicAssert.AreEqual("hello", s.ToAsync().Save("hello").Result); } [Test] @@ -14,7 +14,7 @@ public void TestTrueAsyncSave() { using var f = new TempFile("stuff"); var s = new FileAsyncSaver(f.File); - Assert.AreEqual("hello", s.Save("hello").Result); + ClassicAssert.AreEqual("hello", s.Save("hello").Result); } [Test] @@ -22,6 +22,6 @@ public void TestNonAsyncWrapper() { using var f = new TempFile("stuff"); var s = new FileAsyncSaver(f.File); - Assert.AreEqual("hello", s.ToSynchronous().Save("hello")); + ClassicAssert.AreEqual("hello", s.ToSynchronous().Save("hello")); } } \ No newline at end of file diff --git a/src/ApprovalTests.Tests/Reporters/AssemblyLevelTest.cs b/src/ApprovalTests.Tests/Reporters/AssemblyLevelTest.cs index cedfd3cf..64b21ad1 100644 --- a/src/ApprovalTests.Tests/Reporters/AssemblyLevelTest.cs +++ b/src/ApprovalTests.Tests/Reporters/AssemblyLevelTest.cs @@ -6,7 +6,7 @@ public void TestClassLevel() { using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) { - Assert.AreEqual(typeof(DiffReporter), Approvals.GetReporter().GetType()); + ClassicAssert.AreEqual(typeof(DiffReporter), Approvals.GetReporter().GetType()); } } } \ No newline at end of file diff --git a/src/ApprovalTests.Tests/Reporters/FirstWorkingReporterTest.cs b/src/ApprovalTests.Tests/Reporters/FirstWorkingReporterTest.cs index 231424f2..cff973d5 100644 --- a/src/ApprovalTests.Tests/Reporters/FirstWorkingReporterTest.cs +++ b/src/ApprovalTests.Tests/Reporters/FirstWorkingReporterTest.cs @@ -9,11 +9,11 @@ public void TestCallsFirstAndOnlyFirst() var c = new RecordingReporter(true); var reporter = new FirstWorkingReporter(a, b, c); - Assert.IsTrue(reporter.IsWorkingInThisEnvironment("default.txt")); + ClassicAssert.IsTrue(reporter.IsWorkingInThisEnvironment("default.txt")); reporter.Report("a", "b"); - Assert.IsNull(a.CalledWith); - Assert.AreEqual("a,b", b.CalledWith); - Assert.IsNull(c.CalledWith); + ClassicAssert.IsNull(a.CalledWith); + ClassicAssert.AreEqual("a,b", b.CalledWith); + ClassicAssert.IsNull(c.CalledWith); } [Test] @@ -28,7 +28,7 @@ public void TestException() try { var ex = ExceptionUtilities.GetException(() => new DiffReporter().Report("received.notreal", "received.notreal")); - Assert.AreEqual("Could not find a diff tool for extension: .notreal", ex.Message); + ClassicAssert.AreEqual("Could not find a diff tool for extension: .notreal", ex.Message); } finally { @@ -43,10 +43,10 @@ public void TestCleanup() var cleanup2 = new MockCleanup(); var r = new FirstWorkingReporter(cleanup1, new QuietReporter(), cleanup2); r.CleanUp("a", "r"); - Assert.AreEqual("a", cleanup1.approved); - Assert.AreEqual("a", cleanup2.approved); - Assert.AreEqual("r", cleanup1.received); - Assert.AreEqual("r", cleanup2.received); + ClassicAssert.AreEqual("a", cleanup1.approved); + ClassicAssert.AreEqual("a", cleanup2.approved); + ClassicAssert.AreEqual("r", cleanup1.received); + ClassicAssert.AreEqual("r", cleanup2.received); } } diff --git a/src/ApprovalTests.Tests/Reporters/MultiReporterTest.cs b/src/ApprovalTests.Tests/Reporters/MultiReporterTest.cs index aea7f432..c373fec3 100644 --- a/src/ApprovalTests.Tests/Reporters/MultiReporterTest.cs +++ b/src/ApprovalTests.Tests/Reporters/MultiReporterTest.cs @@ -8,18 +8,18 @@ public void TestMultiReporter() var b = new RecordingReporter(); var multi = new MultiReporter(a, b); multi.Report("a", "r"); - Assert.AreEqual("a,r", a.CalledWith); - Assert.AreEqual("a,r", b.CalledWith); + ClassicAssert.AreEqual("a,r", a.CalledWith); + ClassicAssert.AreEqual("a,r", b.CalledWith); } [Test] public void TestCallAfterException() { - var a = new NUnitReporter(); + var a = new NUnit4Reporter(); var b = new RecordingReporter(); var multi = new MultiReporter(a, b); var exception = ExceptionUtilities.GetException(() => multi.Report("a", "r")); - Assert.AreEqual("a,r", b.CalledWith); - Assert.IsInstanceOf(exception); + ClassicAssert.AreEqual("a,r", b.CalledWith); + ClassicAssert.IsInstanceOf(exception); } } \ No newline at end of file diff --git a/src/ApprovalTests.Tests/Reporters/NUnitReporterTest.cs b/src/ApprovalTests.Tests/Reporters/NUnitReporterTest.cs index a2006a55..d7f478c2 100644 --- a/src/ApprovalTests.Tests/Reporters/NUnitReporterTest.cs +++ b/src/ApprovalTests.Tests/Reporters/NUnitReporterTest.cs @@ -7,7 +7,7 @@ public class NUnitReporterTest public void TestNunitIsWorking() { Approvals.SetCaller(); - Assert.IsTrue(NUnitReporter.INSTANCE.IsWorkingInThisEnvironment("default.txt")); + ClassicAssert.IsTrue(NUnit4Reporter.INSTANCE.IsWorkingInThisEnvironment("default.txt")); } [Test] @@ -23,10 +23,8 @@ public void TestReporter() } catch (Exception e) { - var expectedMessage = string.Format(" String lengths are both 5. Strings differ at index 0.{0} Expected: \"World\"{0} But was: \"Hello\"{0} -----------^{0}", Environment.NewLine); - Assert.AreEqual( - expectedMessage, - e.Message); + var expectedMessage = string.Format(" Assert.That(actual, Is.EqualTo(expected)){0} String lengths are both 5. Strings differ at index 0.{0} Expected: \"World\"{0} But was: \"Hello\"{0} -----------^{0}", Environment.NewLine); + ClassicAssert.AreEqual(expectedMessage, e.Message); } } } \ No newline at end of file diff --git a/src/ApprovalTests.Tests/Reporters/NUnitReporterWithCleanup.cs b/src/ApprovalTests.Tests/Reporters/NUnitReporterWithCleanup.cs index 5f9ef4aa..437f9396 100644 --- a/src/ApprovalTests.Tests/Reporters/NUnitReporterWithCleanup.cs +++ b/src/ApprovalTests.Tests/Reporters/NUnitReporterWithCleanup.cs @@ -1,4 +1,4 @@ -public class NUnitReporterWithCleanup : NUnitReporter +public class NUnitReporterWithCleanup : NUnit4Reporter { public override void Report(string approved, string received) { diff --git a/src/ApprovalTests.Tests/Reporters/ReporterFactoryTest.cs b/src/ApprovalTests.Tests/Reporters/ReporterFactoryTest.cs index 292fc9ed..2128c51f 100644 --- a/src/ApprovalTests.Tests/Reporters/ReporterFactoryTest.cs +++ b/src/ApprovalTests.Tests/Reporters/ReporterFactoryTest.cs @@ -11,14 +11,14 @@ static IEnumerable GetSingletonReporterTypes() } static void SubMethod() => - Assert.AreEqual(typeof(MethodLevelReporter), Approvals.GetReporter().GetType()); + ClassicAssert.AreEqual(typeof(MethodLevelReporter), Approvals.GetReporter().GetType()); [Test] public void TestClassLevel() { using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) { - Assert.AreEqual(typeof(ClassLevelReporter), Approvals.GetReporter().GetType()); + ClassicAssert.AreEqual(typeof(ClassLevelReporter), Approvals.GetReporter().GetType()); } } @@ -28,7 +28,7 @@ public void TestMethodOverride() { using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) { - Assert.AreEqual(typeof(MethodLevelReporter), Approvals.GetReporter().GetType()); + ClassicAssert.AreEqual(typeof(MethodLevelReporter), Approvals.GetReporter().GetType()); } } @@ -39,7 +39,7 @@ public async Task TestAsyncMethodOverride() await Task.Delay(1); using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) { - Assert.AreEqual(typeof(MethodLevelReporter), Approvals.GetReporter().GetType()); + ClassicAssert.AreEqual(typeof(MethodLevelReporter), Approvals.GetReporter().GetType()); } } @@ -59,7 +59,7 @@ public void TestMultipleReporters() { using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) { - Assert.AreEqual(typeof(MultiReporter), Approvals.GetReporter().GetType()); + ClassicAssert.AreEqual(typeof(MultiReporter), Approvals.GetReporter().GetType()); } } @@ -69,7 +69,10 @@ public void TestSingletonOnAllReporters() using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) { var reporters = GetSingletonReporterTypes(); - foreach (var r in reporters) Assert.IsInstanceOf(r, UseReporterAttribute.GetSingleton(r), $"Please add\npublic static readonly {r.FullName} INSTANCE = new {r.FullName}();"); + foreach (var r in reporters) + { + ClassicAssert.IsInstanceOf(r, UseReporterAttribute.GetSingleton(r), $"Please add\npublic static readonly {r.FullName} INSTANCE = new {r.FullName}();"); + } } } } diff --git a/src/ApprovalTests.Tests/Reporters/ReporterTest.cs b/src/ApprovalTests.Tests/Reporters/ReporterTest.cs index 8a904211..04ae4a5a 100644 --- a/src/ApprovalTests.Tests/Reporters/ReporterTest.cs +++ b/src/ApprovalTests.Tests/Reporters/ReporterTest.cs @@ -8,7 +8,7 @@ public void Testname() { var old = Environment.GetEnvironmentVariable(NCrunchReporter.EnvironmentVariable); Environment.SetEnvironmentVariable(NCrunchReporter.EnvironmentVariable, "1"); - Assert.IsTrue(NCrunchReporter.INSTANCE.IsWorkingInThisEnvironment("a.txt")); + ClassicAssert.IsTrue(NCrunchReporter.INSTANCE.IsWorkingInThisEnvironment("a.txt")); Environment.SetEnvironmentVariable(NCrunchReporter.EnvironmentVariable, old); } diff --git a/src/ApprovalTests.Tests/StackTraceScrubberTest.cs b/src/ApprovalTests.Tests/StackTraceScrubberTest.cs index 28f89707..43f6a5b9 100644 --- a/src/ApprovalTests.Tests/StackTraceScrubberTest.cs +++ b/src/ApprovalTests.Tests/StackTraceScrubberTest.cs @@ -5,20 +5,20 @@ public class StackTraceScrubberTest public void TestDashedPath() { const string Path = @"C:\code\ApprovalTests - Net\Persistence\Datasets\DatasetTest.cs"; - Assert.AreEqual("...\\DatasetTest.cs", StackTraceScrubber.ScrubPaths(Path)); + ClassicAssert.AreEqual("...\\DatasetTest.cs", StackTraceScrubber.ScrubPaths(Path)); } [Test] public void TestDashedPathOnMac() { const string Path = "/Users/approver/code/ApprovalTests - Net/Persistence/Datasets/DatasetTest.cs"; - Assert.AreEqual(".../DatasetTest.cs", StackTraceScrubber.ScrubPaths(Path)); + ClassicAssert.AreEqual(".../DatasetTest.cs", StackTraceScrubber.ScrubPaths(Path)); } [Test] public void TestKeyValuePair() { const string Value = "name: File.foo"; - Assert.AreEqual(Value, StackTraceScrubber.ScrubPaths(Value)); + ClassicAssert.AreEqual(Value, StackTraceScrubber.ScrubPaths(Value)); } } \ No newline at end of file diff --git a/src/ApprovalTests.Tests/Writers/WriterFactoryTests.cs b/src/ApprovalTests.Tests/Writers/WriterFactoryTests.cs index f5a399e5..8c08887e 100644 --- a/src/ApprovalTests.Tests/Writers/WriterFactoryTests.cs +++ b/src/ApprovalTests.Tests/Writers/WriterFactoryTests.cs @@ -6,17 +6,17 @@ public class WriterFactoryTests [Test] public void TestTextWriter() { - Assert.IsInstanceOf(WriterFactory.CreateTextWriter("foo")); + ClassicAssert.IsInstanceOf(WriterFactory.CreateTextWriter("foo")); WriterFactory.SetTextWriterCreator(t => new MyTextWriter(t)); - Assert.IsInstanceOf(WriterFactory.CreateTextWriter("foo")); + ClassicAssert.IsInstanceOf(WriterFactory.CreateTextWriter("foo")); } [Test] public void TestTextWriterWithExtension() { - Assert.IsInstanceOf(WriterFactory.CreateTextWriter("foo", ".txt")); + ClassicAssert.IsInstanceOf(WriterFactory.CreateTextWriter("foo", ".txt")); WriterFactory.SetTextWriterCreator((t, e) => new MyTextWriter(t, e)); - Assert.IsInstanceOf(WriterFactory.CreateTextWriter("foo", "txt")); + ClassicAssert.IsInstanceOf(WriterFactory.CreateTextWriter("foo", "txt")); } } diff --git a/src/ApprovalTests.Xunit2/NonNUnitReporterTest.cs b/src/ApprovalTests.Xunit2/NonNUnitReporterTest.cs index 33c72c78..61d95fb2 100644 --- a/src/ApprovalTests.Xunit2/NonNUnitReporterTest.cs +++ b/src/ApprovalTests.Xunit2/NonNUnitReporterTest.cs @@ -4,7 +4,7 @@ public class NonNUnitReporterTest public void TestNunitIsNotWorkingFromXUnit() { Approvals.SetCaller(); - Assert.False(NUnitReporter.INSTANCE.IsWorkingInThisEnvironment("default.txt")); + Assert.False(NUnit4Reporter.INSTANCE.IsWorkingInThisEnvironment("default.txt")); } [Fact] diff --git a/src/ApprovalTests/Reporters/TestFrameworks/FrameworkAssertReporter.cs b/src/ApprovalTests/Reporters/TestFrameworks/FrameworkAssertReporter.cs index 68f5c389..720fd027 100644 --- a/src/ApprovalTests/Reporters/TestFrameworks/FrameworkAssertReporter.cs +++ b/src/ApprovalTests/Reporters/TestFrameworks/FrameworkAssertReporter.cs @@ -6,7 +6,8 @@ public class FrameworkAssertReporter : FirstWorkingReporter public FrameworkAssertReporter() : base(MsTestReporter.INSTANCE, - NUnitReporter.INSTANCE, + NUnit4Reporter.INSTANCE, + NUnit3Reporter.INSTANCE, XUnit2Reporter.INSTANCE) { } diff --git a/src/ApprovalTests/Reporters/TestFrameworks/NUnitReporter.cs b/src/ApprovalTests/Reporters/TestFrameworks/NUnit3Reporter.cs similarity index 56% rename from src/ApprovalTests/Reporters/TestFrameworks/NUnitReporter.cs rename to src/ApprovalTests/Reporters/TestFrameworks/NUnit3Reporter.cs index 5196e656..ea31a9c9 100644 --- a/src/ApprovalTests/Reporters/TestFrameworks/NUnitReporter.cs +++ b/src/ApprovalTests/Reporters/TestFrameworks/NUnit3Reporter.cs @@ -1,10 +1,10 @@ namespace ApprovalTests.Reporters.TestFrameworks; -public class NUnitReporter : AssertReporter +public class NUnit3Reporter : AssertReporter { - public readonly static NUnitReporter INSTANCE = new(); + public readonly static NUnit3Reporter INSTANCE = new(); - public NUnitReporter() + public NUnit3Reporter() : base("NUnit.Framework.Assert, nunit.framework", "AreEqual", NUnitStackTraceParser.Attribute) { } diff --git a/src/ApprovalTests/Reporters/TestFrameworks/NUnit4Reporter.cs b/src/ApprovalTests/Reporters/TestFrameworks/NUnit4Reporter.cs new file mode 100644 index 00000000..f65e07e1 --- /dev/null +++ b/src/ApprovalTests/Reporters/TestFrameworks/NUnit4Reporter.cs @@ -0,0 +1,11 @@ +namespace ApprovalTests.Reporters.TestFrameworks; + +public class NUnit4Reporter : AssertReporter +{ + public readonly static NUnit4Reporter INSTANCE = new(); + + public NUnit4Reporter() + : base("NUnit.Framework.Legacy.ClassicAssert, nunit.framework.legacy", "AreEqual", NUnitStackTraceParser.Attribute) + { + } +} \ No newline at end of file From 27a6ff9d5a9eee04f8bf697ef06f10bbb9d007b1 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 11 May 2024 18:48:34 +1000 Subject: [PATCH 09/12] . --- src/ApprovalTests.NUnit3/NUnitReporterTest.cs | 4 ++-- src/ApprovalTests.Tests/Reporters/NUnitReporterTest.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ApprovalTests.NUnit3/NUnitReporterTest.cs b/src/ApprovalTests.NUnit3/NUnitReporterTest.cs index c9b57630..81617761 100644 --- a/src/ApprovalTests.NUnit3/NUnitReporterTest.cs +++ b/src/ApprovalTests.NUnit3/NUnitReporterTest.cs @@ -19,12 +19,12 @@ public void TestReporter() Approvals.Verify("Hello"); } } - catch (Exception e) + catch (AssertionException exception) { var expectedMessage = string.Format(" String lengths are both 5. Strings differ at index 0.{0} Expected: \"World\"{0} But was: \"Hello\"{0} -----------^{0}", Environment.NewLine); Assert.AreEqual( expectedMessage, - e.Message); + exception.Message); } } } \ No newline at end of file diff --git a/src/ApprovalTests.Tests/Reporters/NUnitReporterTest.cs b/src/ApprovalTests.Tests/Reporters/NUnitReporterTest.cs index d7f478c2..bfafdb74 100644 --- a/src/ApprovalTests.Tests/Reporters/NUnitReporterTest.cs +++ b/src/ApprovalTests.Tests/Reporters/NUnitReporterTest.cs @@ -21,7 +21,7 @@ public void TestReporter() Approvals.Verify("Hello"); } } - catch (Exception e) + catch (AssertionException e) { var expectedMessage = string.Format(" Assert.That(actual, Is.EqualTo(expected)){0} String lengths are both 5. Strings differ at index 0.{0} Expected: \"World\"{0} But was: \"Hello\"{0} -----------^{0}", Environment.NewLine); ClassicAssert.AreEqual(expectedMessage, e.Message); From 28da17204997b259fd783fd0468a92ce2fdc726b Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 11 May 2024 19:23:17 +1000 Subject: [PATCH 10/12] Update AssertReporter.cs --- src/ApprovalTests/Reporters/TestFrameworks/AssertReporter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ApprovalTests/Reporters/TestFrameworks/AssertReporter.cs b/src/ApprovalTests/Reporters/TestFrameworks/AssertReporter.cs index fe3a1f5b..5e957c1f 100644 --- a/src/ApprovalTests/Reporters/TestFrameworks/AssertReporter.cs +++ b/src/ApprovalTests/Reporters/TestFrameworks/AssertReporter.cs @@ -31,7 +31,7 @@ public void AssertEqual(string approvedContent, string receivedContent) { try { - var type = Type.GetType(assertClass); + var type = Type.GetType(assertClass, true); var parameters = new[] { approvedContent, receivedContent }; InvokeEqualsMethod(type, parameters); } From 3a6227b41ed3d8848cdfde14fe78d57e8d130b60 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 11 May 2024 19:29:48 +1000 Subject: [PATCH 11/12] Update FrameworkAssertReporter.cs --- .../Reporters/TestFrameworks/FrameworkAssertReporter.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ApprovalTests/Reporters/TestFrameworks/FrameworkAssertReporter.cs b/src/ApprovalTests/Reporters/TestFrameworks/FrameworkAssertReporter.cs index 720fd027..5e2c94dd 100644 --- a/src/ApprovalTests/Reporters/TestFrameworks/FrameworkAssertReporter.cs +++ b/src/ApprovalTests/Reporters/TestFrameworks/FrameworkAssertReporter.cs @@ -5,9 +5,10 @@ public class FrameworkAssertReporter : FirstWorkingReporter public static readonly FrameworkAssertReporter INSTANCE = new(); public FrameworkAssertReporter() - : base(MsTestReporter.INSTANCE, - NUnit4Reporter.INSTANCE, + : base( + MsTestReporter.INSTANCE, NUnit3Reporter.INSTANCE, + NUnit4Reporter.INSTANCE, XUnit2Reporter.INSTANCE) { } From 7f5b67847e1413a7a1ecbdbef0035f54b801cb20 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 11 May 2024 19:42:21 +1000 Subject: [PATCH 12/12] . --- .../TestFrameworks/FrameworkAssertReporter.cs | 2 +- .../Reporters/TestFrameworks/NUnit4Reporter.cs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/ApprovalTests/Reporters/TestFrameworks/FrameworkAssertReporter.cs b/src/ApprovalTests/Reporters/TestFrameworks/FrameworkAssertReporter.cs index 5e2c94dd..c821a6d6 100644 --- a/src/ApprovalTests/Reporters/TestFrameworks/FrameworkAssertReporter.cs +++ b/src/ApprovalTests/Reporters/TestFrameworks/FrameworkAssertReporter.cs @@ -7,8 +7,8 @@ public class FrameworkAssertReporter : FirstWorkingReporter public FrameworkAssertReporter() : base( MsTestReporter.INSTANCE, - NUnit3Reporter.INSTANCE, NUnit4Reporter.INSTANCE, + NUnit3Reporter.INSTANCE, XUnit2Reporter.INSTANCE) { } diff --git a/src/ApprovalTests/Reporters/TestFrameworks/NUnit4Reporter.cs b/src/ApprovalTests/Reporters/TestFrameworks/NUnit4Reporter.cs index f65e07e1..f4d8cf48 100644 --- a/src/ApprovalTests/Reporters/TestFrameworks/NUnit4Reporter.cs +++ b/src/ApprovalTests/Reporters/TestFrameworks/NUnit4Reporter.cs @@ -3,6 +3,22 @@ namespace ApprovalTests.Reporters.TestFrameworks; public class NUnit4Reporter : AssertReporter { public readonly static NUnit4Reporter INSTANCE = new(); + static readonly Lazy isNUnit4 = new(IsisNUnit4); + + static bool IsisNUnit4() + { + return AppDomain + .CurrentDomain + .GetAssemblies() + .Any(_ => + { + var name = _.FullName; + return name.Contains("nunit.framework.legacy"); + }); + } + + public override bool IsWorkingInThisEnvironment(string forFile) => + base.IsWorkingInThisEnvironment(forFile) && isNUnit4.Value; public NUnit4Reporter() : base("NUnit.Framework.Legacy.ClassicAssert, nunit.framework.legacy", "AreEqual", NUnitStackTraceParser.Attribute)