diff --git a/docs/anonymous-types.md b/docs/anonymous-types.md index 2dbc5a7bc8..c5d549d280 100644 --- a/docs/anonymous-types.md +++ b/docs/anonymous-types.md @@ -37,7 +37,7 @@ public Task Anon() }); } ``` -snippet source | anchor +snippet source | anchor @@ -68,7 +68,7 @@ public async Task Anon() }); } ``` -snippet source | anchor +snippet source | anchor @@ -99,7 +99,7 @@ public async Task Anon() }); } ``` -snippet source | anchor +snippet source | anchor diff --git a/docs/build-server.md b/docs/build-server.md index fbf88a6d7f..22e38bb265 100644 --- a/docs/build-server.md +++ b/docs/build-server.md @@ -63,5 +63,5 @@ if (BuildServerDetector.Detected) }); } ``` -snippet source | anchor +snippet source | anchor diff --git a/docs/clipboard.md b/docs/clipboard.md index 363cdd1f7b..a79ea157be 100644 --- a/docs/clipboard.md +++ b/docs/clipboard.md @@ -64,7 +64,7 @@ The clipboard behavior can be disable using the following: ```cs VerifierSettings.DisableClipboard(); ``` -snippet source | anchor +snippet source | anchor diff --git a/docs/compared-to-assertion.md b/docs/compared-to-assertion.md index be33e1d55a..3057f9542b 100644 --- a/docs/compared-to-assertion.md +++ b/docs/compared-to-assertion.md @@ -83,7 +83,7 @@ public void TraditionalTest() Assert.Equal("USA", person.Address.Country); } ``` -snippet source | anchor +snippet source | anchor @@ -99,7 +99,7 @@ public Task SnapshotTest() return Verifier.Verify(person); } ``` -snippet source | anchor +snippet source | anchor Produces a snapshot file `SnapshotTest.verified.txt`: diff --git a/docs/comparer.md b/docs/comparer.md index cc231dc4f4..c4c2a27323 100644 --- a/docs/comparer.md +++ b/docs/comparer.md @@ -34,7 +34,7 @@ static Task CompareImages( return Task.FromResult(result); } ``` -snippet source | anchor +snippet source | anchor The returned `CompareResult.NotEqual` takes an optional message that will be rendered in the resulting text displayed to the user on test failure. @@ -64,7 +64,7 @@ public Task InstanceComparerFluent() .UseExtension("png"); } ``` -snippet source | anchor +snippet source | anchor @@ -78,7 +78,7 @@ VerifierSettings.RegisterStreamComparer( compare: CompareImages); await Verifier.VerifyFile("TheImage.png"); ``` -snippet source | anchor +snippet source | anchor diff --git a/docs/converter.md b/docs/converter.md index 217ae4c8fd..31b4f35640 100644 --- a/docs/converter.md +++ b/docs/converter.md @@ -76,7 +76,7 @@ VerifierSettings.RegisterFileConverter( targets); }); ``` -snippet source | anchor +snippet source | anchor @@ -85,7 +85,7 @@ VerifierSettings.RegisterFileConverter( using var stream = File.OpenRead("sample.tif"); await Verifier.Verify(Image.FromStream(stream)); ``` -snippet source | anchor +snippet source | anchor Note that this sample also uses the optional `canConvert` to ensure that only `Image`s that are tiffs are converted. @@ -95,7 +95,7 @@ Note that this sample also uses the optional `canConvert` to ensure that only `I ```cs canConvert: (target, extension, context) => Equals(target.RawFormat, ImageFormat.Tiff), ``` -snippet source | anchor +snippet source | anchor @@ -132,7 +132,7 @@ VerifierSettings.RegisterFileConverter( targets); }); ``` -snippet source | anchor +snippet source | anchor @@ -140,7 +140,7 @@ VerifierSettings.RegisterFileConverter( ```cs await Verifier.VerifyFile("sample.tif"); ``` -snippet source | anchor +snippet source | anchor @@ -161,7 +161,7 @@ return new( return Task.CompletedTask; }); ``` -snippet source | anchor +snippet source | anchor diff --git a/docs/named-tuples.md b/docs/named-tuples.md index c5192de1a4..cb478fe1af 100644 --- a/docs/named-tuples.md +++ b/docs/named-tuples.md @@ -21,7 +21,7 @@ static (bool Member1, string Member2, string Member3) MethodWithNamedTuple() return (true, "A", "B"); } ``` -snippet source | anchor +snippet source | anchor Can be verified: @@ -31,7 +31,7 @@ Can be verified: ```cs await Verifier.VerifyTuple(() => MethodWithNamedTuple()); ``` -snippet source | anchor +snippet source | anchor Resulting in: diff --git a/docs/naming.md b/docs/naming.md index b3efde9ccb..022fb31af1 100644 --- a/docs/naming.md +++ b/docs/naming.md @@ -27,7 +27,7 @@ var settings = new VerifySettings(); settings.UseDirectory("CustomDirectory"); await Verifier.Verify("value", settings); ``` -snippet source | anchor +snippet source | anchor @@ -36,7 +36,7 @@ await Verifier.Verify("value", settings); await Verifier.Verify("value") .UseDirectory("CustomDirectory"); ``` -snippet source | anchor +snippet source | anchor Will result in `CustomDirectory/TypeName.MethodName.verified.txt`. @@ -55,7 +55,7 @@ var settings = new VerifySettings(); settings.UseTypeName("CustomTypeName"); await Verifier.Verify("value", settings); ``` -snippet source | anchor +snippet source | anchor @@ -64,7 +64,7 @@ await Verifier.Verify("value", settings); await Verifier.Verify("value") .UseTypeName("CustomTypeName"); ``` -snippet source | anchor +snippet source | anchor Will result in `CustomTypeName.MethodName.verified.txt`. @@ -81,7 +81,7 @@ var settings = new VerifySettings(); settings.UseMethodName("CustomMethodName"); await Verifier.Verify("value", settings); ``` -snippet source | anchor +snippet source | anchor Will result in `TestClass.CustomMethodName.verified.txt`. @@ -92,7 +92,7 @@ Will result in `TestClass.CustomMethodName.verified.txt`. await Verifier.Verify("value") .UseMethodName("CustomMethodNameFluent"); ``` -snippet source | anchor +snippet source | anchor Will result in `TestClass.CustomMethodNameFluent.verified.txt`. @@ -116,7 +116,7 @@ public async Task MultipleCalls() .UseMethodName("MultipleCalls_2")); } ``` -snippet source | anchor +snippet source | anchor @@ -131,7 +131,7 @@ var settings = new VerifySettings(); settings.UseFileName("CustomFileName"); await Verifier.Verify("value", settings); ``` -snippet source | anchor +snippet source | anchor Will result in `CustomFileName.verified.txt`. @@ -142,7 +142,7 @@ Will result in `CustomFileName.verified.txt`. await Verifier.Verify("value") .UseFileName("CustomFileNameFluent"); ``` -snippet source | anchor +snippet source | anchor Will result in `UseFileNameFluent.verified.txt`. @@ -241,7 +241,7 @@ public class UniqueForSample } } ``` -snippet source | anchor +snippet source | anchor @@ -329,7 +329,7 @@ public class UniqueForSample } } ``` -snippet source | anchor +snippet source | anchor @@ -435,7 +435,7 @@ public class UniqueForSample : } } ``` -snippet source | anchor +snippet source | anchor @@ -527,7 +527,7 @@ public class ExtensionSample } } ``` -snippet source | anchor +snippet source | anchor Result in two files: @@ -567,7 +567,7 @@ To access the current Namer `Runtime` or `RuntimeAndVersion` strings use: Debug.WriteLine(Namer.Runtime); Debug.WriteLine(Namer.RuntimeAndVersion); ``` -snippet source | anchor +snippet source | anchor @@ -594,7 +594,7 @@ VerifierSettings.DerivePathInfo( methodName: method.Name); }); ``` -snippet source | anchor +snippet source | anchor Return null to any of the values to use the standard behavior. The returned path can be relative to the directory sourceFile exists in. diff --git a/docs/parameterised.md b/docs/parameterised.md index 1823e77bc6..beff9bb0dc 100644 --- a/docs/parameterised.md +++ b/docs/parameterised.md @@ -52,7 +52,7 @@ public Task InlineDataUsageFluent(string arg) .UseParameters(arg); } ``` -snippet source | anchor +snippet source | anchor @@ -84,7 +84,7 @@ public static IEnumerable GetData() yield return new object[] {"Value2"}; } ``` -snippet source | anchor +snippet source | anchor @@ -139,7 +139,7 @@ public class ComplexParametersSample } } ``` -snippet source | anchor +snippet source | anchor `VerifierSettings.NameForParameter` is required since the parameter type has no `ToString()` override that can be used for deriving the name of the `.verified.` file. @@ -160,7 +160,7 @@ public Task TestCaseUsage(string arg) return Verifier.Verify(arg); } ``` -snippet source | anchor +snippet source | anchor @@ -198,7 +198,7 @@ public class ParametersSample : } } ``` -snippet source | anchor +snippet source | anchor @@ -232,7 +232,7 @@ public Task UseTextForParametersFluent(string arg) .UseTextForParameters(arg); } ``` -snippet source | anchor +snippet source | anchor Results in: diff --git a/docs/scrubbers.md b/docs/scrubbers.md index af62ec275d..45c878f316 100644 --- a/docs/scrubbers.md +++ b/docs/scrubbers.md @@ -56,7 +56,7 @@ For example remove lines containing `text`: ```cs verifySettings.ScrubLines(line => line.Contains("text")); ``` -snippet source | anchor +snippet source | anchor @@ -71,7 +71,7 @@ For example remove lines containing `text1` or `text2` ```cs verifySettings.ScrubLinesContaining("text1", "text2"); ``` -snippet source | anchor +snippet source | anchor Case insensitive by default (StringComparison.OrdinalIgnoreCase). @@ -83,7 +83,7 @@ Case insensitive by default (StringComparison.OrdinalIgnoreCase). ```cs verifySettings.ScrubLinesContaining(StringComparison.Ordinal, "text1", "text2"); ``` -snippet source | anchor +snippet source | anchor @@ -98,7 +98,7 @@ For example converts lines to upper case: ```cs verifySettings.ScrubLinesWithReplace(line => line.ToUpper()); ``` -snippet source | anchor +snippet source | anchor @@ -111,7 +111,7 @@ Replaces `Environment.MachineName` with `TheMachineName`. ```cs verifySettings.ScrubMachineName(); ``` -snippet source | anchor +snippet source | anchor @@ -252,7 +252,7 @@ public class ScrubbersSample } } ``` -snippet source | anchor +snippet source | anchor @@ -385,7 +385,7 @@ public class ScrubbersSample } } ``` -snippet source | anchor +snippet source | anchor @@ -519,7 +519,7 @@ public class ScrubbersSample : } } ``` -snippet source | anchor +snippet source | anchor @@ -594,7 +594,7 @@ public class ScrubberLevelsSample } } ``` -snippet source | anchor +snippet source | anchor @@ -636,7 +636,7 @@ public class ScrubberLevelsSample } } ``` -snippet source | anchor +snippet source | anchor @@ -679,7 +679,7 @@ public class ScrubberLevelsSample : } } ``` -snippet source | anchor +snippet source | anchor diff --git a/docs/serializer-settings.md b/docs/serializer-settings.md index 38f25be0ca..2b08bd0179 100644 --- a/docs/serializer-settings.md +++ b/docs/serializer-settings.md @@ -33,7 +33,7 @@ To use strict json call `VerifierSettings.UseStrictJson`: ```cs VerifierSettings.UseStrictJson(); ``` -snippet source | anchor +snippet source | anchor Then this result in @@ -53,7 +53,7 @@ var target = new TheTarget }; await Verifier.Verify(target); ``` -snippet source | anchor +snippet source | anchor The resulting file will be: @@ -100,7 +100,7 @@ VerifierSettings.ModifySerialization(settings => settings.AddExtraSettings(serializerSettings => serializerSettings.DateFormatHandling = DateFormatHandling.MicrosoftDateFormat)); ``` -snippet source | anchor +snippet source | anchor @@ -121,7 +121,7 @@ public Task AddExtraSettings() return Verifier.Verify(target, verifySettings); } ``` -snippet source | anchor +snippet source | anchor @@ -141,7 +141,7 @@ public Task AddExtraSettingsFluent() serializerSettings.DefaultValueHandling = DefaultValueHandling.Include)); } ``` -snippet source | anchor +snippet source | anchor @@ -161,7 +161,7 @@ To disable this behavior globally use: ```cs VerifierSettings.ModifySerialization(_ => _.DontIgnoreEmptyCollections()); ``` -snippet source | anchor +snippet source | anchor @@ -183,7 +183,7 @@ var target = new GuidTarget await Verifier.Verify(target); ``` -snippet source | anchor +snippet source | anchor Results in the following: @@ -208,7 +208,7 @@ Strings containing inline Guids can also be scrubbed. To enable this behavior, u ```cs VerifierSettings.ScrubInlineGuids(); ``` -snippet source | anchor +snippet source | anchor @@ -223,7 +223,7 @@ var settings = new VerifySettings(); settings.ModifySerialization(_ => _.DontScrubGuids()); await Verifier.Verify(target, settings); ``` -snippet source | anchor +snippet source | anchor Or with the fluent api: @@ -234,7 +234,7 @@ Or with the fluent api: await Verifier.Verify(target) .ModifySerialization(_ => _.DontScrubGuids()); ``` -snippet source | anchor +snippet source | anchor To disable this behavior globally use: @@ -244,7 +244,7 @@ To disable this behavior globally use: ```cs VerifierSettings.ModifySerialization(_ => _.DontScrubGuids()); ``` -snippet source | anchor +snippet source | anchor @@ -272,7 +272,7 @@ var target = new DateTimeTarget await Verifier.Verify(target); ``` -snippet source | anchor +snippet source | anchor Results in the following: @@ -310,7 +310,7 @@ settings.ModifySerialization(_ => _.DontScrubDateTimes()); return Verifier.Verify(target, settings); ``` -snippet source | anchor +snippet source | anchor Or using the fluent api use: @@ -326,7 +326,7 @@ var target = new return Verifier.Verify(target) .ModifySerialization(_ => _.DontScrubDateTimes()); ``` -snippet source | anchor +snippet source | anchor Or globally use: @@ -336,7 +336,7 @@ Or globally use: ```cs VerifierSettings.ModifySerialization(_ => _.DontScrubDateTimes()); ``` -snippet source | anchor +snippet source | anchor @@ -362,7 +362,7 @@ public Task NumericIdScrubbing() return Verifier.Verify(target); } ``` -snippet source | anchor +snippet source | anchor Results in the following: @@ -403,7 +403,7 @@ public Task TreatAsNumericId() member => member.Name == "TheProperty")); } ``` -snippet source | anchor +snippet source | anchor To define a convention globally use: @@ -424,7 +424,7 @@ public Task TreatAsNumericIdGlobal() return Verifier.Verify(target); } ``` -snippet source | anchor +snippet source | anchor @@ -450,7 +450,7 @@ public Task NumericIdScrubbingDisabled() .ModifySerialization(settings => settings.DontScrubNumericIds()); } ``` -snippet source | anchor +snippet source | anchor To disable this behavior globally use: @@ -473,7 +473,7 @@ public Task NumericIdScrubbingDisabledGlobal() }); } ``` -snippet source | anchor +snippet source | anchor @@ -488,7 +488,7 @@ To disable this behavior globally use: ```cs VerifierSettings.ModifySerialization(_ => _.DontIgnoreFalse()); ``` -snippet source | anchor +snippet source | anchor @@ -510,7 +510,7 @@ settings.ModifySerialization(_ => }); await Verify(target, settings); ``` -snippet source | anchor +snippet source | anchor ```cs await Verify(target) @@ -522,7 +522,7 @@ await Verify(target) _.DontIgnoreFalse(); }); ``` -snippet source | anchor +snippet source | anchor ```cs await Verifier.Verify(target) @@ -534,7 +534,7 @@ await Verifier.Verify(target) _.DontIgnoreFalse(); }); ``` -snippet source | anchor +snippet source | anchor @@ -554,7 +554,7 @@ VerifierSettings.AddExtraSettings(_ => _.TypeNameHandling = TypeNameHandling.All; }); ``` -snippet source | anchor +snippet source | anchor @@ -570,7 +570,7 @@ settings.AddExtraSettings(_ => _.TypeNameHandling = TypeNameHandling.All; }); ``` -snippet source | anchor +snippet source | anchor @@ -594,7 +594,7 @@ class CompanyConverter : } } ``` -snippet source | anchor +snippet source | anchor @@ -606,7 +606,7 @@ VerifierSettings.AddExtraSettings( _.Converters.Add(new CompanyConverter()); }); ``` -snippet source | anchor +snippet source | anchor @@ -642,7 +642,7 @@ public Task ScopedSerializerFluent() _ => { _.TypeNameHandling = TypeNameHandling.All; }); } ``` -snippet source | anchor +snippet source | anchor Result: @@ -705,7 +705,7 @@ public Task IgnoreTypeFluent() } ``` -snippet source | anchor +snippet source | anchor Or globally: @@ -716,7 +716,7 @@ Or globally: VerifierSettings.ModifySerialization( _ => _.IgnoreMembersWithType()); ``` -snippet source | anchor +snippet source | anchor Result: @@ -780,7 +780,7 @@ public Task AddIgnoreInstanceFluent() _ => { _.IgnoreInstance(x => x.Property == "Ignore"); }); } ``` -snippet source | anchor +snippet source | anchor Or globally: @@ -791,7 +791,7 @@ Or globally: VerifierSettings.ModifySerialization( _ => { _.IgnoreInstance(x => x.Property == "Ignore"); }); ``` -snippet source | anchor +snippet source | anchor Result: @@ -835,7 +835,7 @@ public Task WithObsoleteProp() return Verifier.Verify(target); } ``` -snippet source | anchor +snippet source | anchor Result: @@ -883,7 +883,7 @@ public Task WithObsoletePropIncludedFluent() .ModifySerialization(_ => { _.IncludeObsoletes(); }); } ``` -snippet source | anchor +snippet source | anchor Or globally: @@ -893,7 +893,7 @@ Or globally: ```cs VerifierSettings.ModifySerialization(_ => { _.IncludeObsoletes(); }); ``` -snippet source | anchor +snippet source | anchor Result: @@ -958,7 +958,7 @@ public Task IgnoreMemberByExpressionFluent() }); } ``` -snippet source | anchor +snippet source | anchor Or globally @@ -975,7 +975,7 @@ VerifierSettings.ModifySerialization(_ => _.IgnoreMember(x => x.PropertyThatThrows); }); ``` -snippet source | anchor +snippet source | anchor Result: @@ -1043,7 +1043,7 @@ public Task IgnoreMemberByNameFluent() }); } ``` -snippet source | anchor +snippet source | anchor Or globally: @@ -1061,7 +1061,7 @@ VerifierSettings.ModifySerialization(_ => _.IgnoreMember(type, "PropertyThatThrows"); }); ``` -snippet source | anchor +snippet source | anchor Result: @@ -1107,7 +1107,7 @@ public Task CustomExceptionPropFluent() .ModifySerialization(_ => _.IgnoreMembersThatThrow()); } ``` -snippet source | anchor +snippet source | anchor Or globally: @@ -1117,7 +1117,7 @@ Or globally: ```cs VerifierSettings.ModifySerialization(_ => _.IgnoreMembersThatThrow()); ``` -snippet source | anchor +snippet source | anchor Result: @@ -1156,7 +1156,7 @@ public Task ExceptionMessagePropFluent() _ => _.IgnoreMembersThatThrow(x => x.Message == "Ignore")); } ``` -snippet source | anchor +snippet source | anchor Or globally: @@ -1167,7 +1167,7 @@ Or globally: VerifierSettings.ModifySerialization( _ => _.IgnoreMembersThatThrow(x => x.Message == "Ignore")); ``` -snippet source | anchor +snippet source | anchor Result: @@ -1272,7 +1272,7 @@ Extra types can be added to this mapping: VerifierSettings.TreatAsString( (target, settings) => target.Property); ``` -snippet source | anchor +snippet source | anchor @@ -1320,7 +1320,7 @@ public Task MemberConverterByExpressionFluent() }); } ``` -snippet source | anchor +snippet source | anchor This can also be configured globally: @@ -1338,7 +1338,7 @@ VerifierSettings.ModifySerialization(_ => (target, value) => value + "Suffix"); }); ``` -snippet source | anchor +snippet source | anchor @@ -1358,7 +1358,7 @@ static class ModuleInitializer } } ``` -snippet source | anchor +snippet source | anchor @@ -1382,7 +1382,7 @@ VerifierSettings.RegisterJsonAppender( return null; }); ``` -snippet source | anchor +snippet source | anchor When when content is verified: @@ -1396,7 +1396,7 @@ public Task WithJsonAppender() return Verifier.Verify("TheValue"); } ``` -snippet source | anchor +snippet source | anchor The content from RegisterJsonAppender will be included in the output: @@ -1423,7 +1423,7 @@ public Task Stream() return Verifier.Verify(FileHelpers.OpenRead("sample.txt")); } ``` -snippet source | anchor +snippet source | anchor Then the appended content will be added to the `*.00.verified.txt` file: diff --git a/docs/verify-options.md b/docs/verify-options.md index 2c05d9ec2f..d84bd09b3c 100644 --- a/docs/verify-options.md +++ b/docs/verify-options.md @@ -22,7 +22,7 @@ This can be done using `AutoVerify()`: var settings = new VerifySettings(); settings.AutoVerify(); ``` -snippet source | anchor +snippet source | anchor Note that auto accepted changes in `.verified.` files remain visible in source control tooling. @@ -59,5 +59,5 @@ public Task OnHandlersSample() return Verifier.Verify("value"); } ``` -snippet source | anchor +snippet source | anchor diff --git a/readme.md b/readme.md index 83ca30742c..f7c2d83892 100644 --- a/readme.md +++ b/readme.md @@ -99,7 +99,7 @@ public class Sample } } ``` -snippet source | anchor +snippet source | anchor * [Verify Xunit Intro](https://www.youtube.com/watch?v=uGVogEltSkY) @@ -123,7 +123,7 @@ public class Sample } } ``` -snippet source | anchor +snippet source | anchor @@ -180,7 +180,7 @@ public class Sample : } } ``` -snippet source | anchor +snippet source | anchor @@ -335,7 +335,7 @@ public Task VerifyJsonJToken() return Verifier.VerifyJson(target); } ``` -snippet source | anchor +snippet source | anchor Results in: @@ -368,10 +368,6 @@ When modifying settings at the both global level it should be done using a Modul ```cs -using VerifyTests; -using VerifyXunit; -using Xunit; - [UsesVerify] public class StaticSettings { @@ -391,7 +387,7 @@ public static class StaticSettingsUsage } } ``` -snippet source | anchor +snippet source | anchor diff --git a/src/DeterministicTests/DeterministicTests.csproj b/src/DeterministicTests/DeterministicTests.csproj index 3147384032..c3541124d0 100644 --- a/src/DeterministicTests/DeterministicTests.csproj +++ b/src/DeterministicTests/DeterministicTests.csproj @@ -17,6 +17,7 @@ + diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 94c621f512..283a3ff8c0 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -2,7 +2,8 @@ CS1591;CS0649;xUnit1026;xUnit1013;msb3277;CS0436 - 14.6.6 + 14.7.0 + enable 10 1.0.0 Json, Testing, Verify, Snapshot, Approvals diff --git a/src/DisableClipboard/DisableClipboard.csproj b/src/DisableClipboard/DisableClipboard.csproj index 7739390a31..e63a45874f 100644 --- a/src/DisableClipboard/DisableClipboard.csproj +++ b/src/DisableClipboard/DisableClipboard.csproj @@ -14,4 +14,5 @@ + \ No newline at end of file diff --git a/src/DisableClipboard/DisableClipboardTests.cs b/src/DisableClipboard/DisableClipboardTests.cs index 24a4fc6273..5c05ba686a 100644 --- a/src/DisableClipboard/DisableClipboardTests.cs +++ b/src/DisableClipboard/DisableClipboardTests.cs @@ -1,8 +1,5 @@ using DiffEngine; using TextCopy; -using VerifyTests; -using VerifyXunit; -using Xunit; [UsesVerify] public class DisableClipboardTests diff --git a/src/DisableDirScrubbing/DisableDirScrubbingTests.cs b/src/DisableDirScrubbing/DisableDirScrubbingTests.cs index 0734ee82f5..9e16f1d741 100644 --- a/src/DisableDirScrubbing/DisableDirScrubbingTests.cs +++ b/src/DisableDirScrubbing/DisableDirScrubbingTests.cs @@ -1,5 +1,4 @@ -using VerifyTests; -using VerifyXunit; +using VerifyXunit; using Xunit; [UsesVerify] diff --git a/src/FakeDiffTool/Program.cs b/src/FakeDiffTool/Program.cs index 1fcc5943ee..6d8793f2b6 100644 --- a/src/FakeDiffTool/Program.cs +++ b/src/FakeDiffTool/Program.cs @@ -1,3 +1 @@ -using System.Threading; - -Thread.Sleep(5000); +Thread.Sleep(5000); diff --git a/src/SortedPropertiesTests/SortedPropertiesTests.cs b/src/SortedPropertiesTests/SortedPropertiesTests.cs index 4e9ff16c79..f94cadc8d5 100644 --- a/src/SortedPropertiesTests/SortedPropertiesTests.cs +++ b/src/SortedPropertiesTests/SortedPropertiesTests.cs @@ -1,7 +1,4 @@ using Newtonsoft.Json; -using VerifyTests; -using VerifyXunit; -using Xunit; #region SortProperties static class ModuleInitializer diff --git a/src/SortedPropertiesTests/SortedPropertiesTests.csproj b/src/SortedPropertiesTests/SortedPropertiesTests.csproj index e80c17053f..0cdffe0ad3 100644 --- a/src/SortedPropertiesTests/SortedPropertiesTests.csproj +++ b/src/SortedPropertiesTests/SortedPropertiesTests.csproj @@ -14,4 +14,5 @@ + \ No newline at end of file diff --git a/src/StrictJsonTests/StrictJsonTests.csproj b/src/StrictJsonTests/StrictJsonTests.csproj index e80c17053f..0cdffe0ad3 100644 --- a/src/StrictJsonTests/StrictJsonTests.csproj +++ b/src/StrictJsonTests/StrictJsonTests.csproj @@ -14,4 +14,5 @@ + \ No newline at end of file diff --git a/src/StrictJsonTests/Tests.cs b/src/StrictJsonTests/Tests.cs index 6d4377ce0c..3b7b390877 100644 --- a/src/StrictJsonTests/Tests.cs +++ b/src/StrictJsonTests/Tests.cs @@ -1,8 +1,4 @@ -using VerifyTests; -using VerifyXunit; -using Xunit; - -[UsesVerify] +[UsesVerify] public class Tests { static Tests() diff --git a/src/TargetLibrary/ClassBeingTestedChanged.cs b/src/TargetLibrary/ClassBeingTestedChanged.cs index a9751ffe7a..e5d4711ac2 100644 --- a/src/TargetLibrary/ClassBeingTestedChanged.cs +++ b/src/TargetLibrary/ClassBeingTestedChanged.cs @@ -1,31 +1,30 @@ -namespace Changed +namespace Changed; + +#region ClassBeingTestedChanged +public static class ClassBeingTested { - #region ClassBeingTestedChanged - public static class ClassBeingTested + public static Person FindPerson() { - public static Person FindPerson() + return new() { - return new() + Id = new("ebced679-45d3-4653-8791-3d969c4a986c"), + Title = Title.Mr, + // Middle name added + GivenNames = "John James", + FamilyName = "Smith", + Spouse = "Jill", + Children = new() { - Id = new("ebced679-45d3-4653-8791-3d969c4a986c"), - Title = Title.Mr, - // Middle name added - GivenNames = "John James", - FamilyName = "Smith", - Spouse = "Jill", - Children = new() - { - "Sam", - "Mary" - }, - Address = new() - { - // Address changed - Street = "64 Barnett Street", - Country = "USA" - } - }; - } + "Sam", + "Mary" + }, + Address = new() + { + // Address changed + Street = "64 Barnett Street", + Country = "USA" + } + }; } - #endregion -} \ No newline at end of file +} +#endregion \ No newline at end of file diff --git a/src/TargetLibrary/SampleModels.cs b/src/TargetLibrary/SampleModels.cs index 54c735cdb5..64b367c07f 100644 --- a/src/TargetLibrary/SampleModels.cs +++ b/src/TargetLibrary/SampleModels.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; - -// Non-nullable field is uninitialized. +// Non-nullable field is uninitialized. #pragma warning disable CS8618 public class Person { diff --git a/src/Verify.DerivePaths.Tests/Tests.cs b/src/Verify.DerivePaths.Tests/Tests.cs index d064e9dfc6..a6ebf6deb4 100644 --- a/src/Verify.DerivePaths.Tests/Tests.cs +++ b/src/Verify.DerivePaths.Tests/Tests.cs @@ -1,8 +1,4 @@ -using VerifyTests; -using VerifyXunit; -using Xunit; - -[UsesVerify] +[UsesVerify] public class Tests { [Fact] diff --git a/src/Verify.DerivePaths.Tests/Verify.DerivePaths.Tests.csproj b/src/Verify.DerivePaths.Tests/Verify.DerivePaths.Tests.csproj index ef6f5384e4..52ebb80476 100644 --- a/src/Verify.DerivePaths.Tests/Verify.DerivePaths.Tests.csproj +++ b/src/Verify.DerivePaths.Tests/Verify.DerivePaths.Tests.csproj @@ -14,4 +14,5 @@ + \ No newline at end of file diff --git a/src/Verify.Expecto.Tests/Program.cs b/src/Verify.Expecto.Tests/Program.cs index 398086f745..c249fb1285 100644 --- a/src/Verify.Expecto.Tests/Program.cs +++ b/src/Verify.Expecto.Tests/Program.cs @@ -1,3 +1 @@ -using Expecto.CSharp; - -return Runner.RunTestsInAssembly(Runner.DefaultConfig, args); \ No newline at end of file +return Runner.RunTestsInAssembly(Runner.DefaultConfig, args); \ No newline at end of file diff --git a/src/Verify.Expecto.Tests/Tests.cs b/src/Verify.Expecto.Tests/Tests.cs index c5bc3715f1..9b80e0276e 100644 --- a/src/Verify.Expecto.Tests/Tests.cs +++ b/src/Verify.Expecto.Tests/Tests.cs @@ -1,8 +1,4 @@ -using Expecto; -using Expecto.CSharp; -using VerifyExpecto; - -public class Tests +public class Tests { [Tests] public static Test tests = Runner.TestCase( diff --git a/src/Verify.Expecto.Tests/Verify.Expecto.Tests.csproj b/src/Verify.Expecto.Tests/Verify.Expecto.Tests.csproj index 24f3294e30..c9b1270423 100644 --- a/src/Verify.Expecto.Tests/Verify.Expecto.Tests.csproj +++ b/src/Verify.Expecto.Tests/Verify.Expecto.Tests.csproj @@ -11,4 +11,5 @@ + \ No newline at end of file diff --git a/src/Verify.Expecto/Verify.Expecto.csproj b/src/Verify.Expecto/Verify.Expecto.csproj index 627fc32982..467fc5aa64 100644 --- a/src/Verify.Expecto/Verify.Expecto.csproj +++ b/src/Verify.Expecto/Verify.Expecto.csproj @@ -6,13 +6,14 @@ netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1;net461;net472;net5;net6 + - + + + \ No newline at end of file diff --git a/src/Verify.Expecto/buildTransitive/Verify.Expecto.props b/src/Verify.Expecto/buildTransitive/Verify.Expecto.props new file mode 100644 index 0000000000..c4d4b32457 --- /dev/null +++ b/src/Verify.Expecto/buildTransitive/Verify.Expecto.props @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/Verify.Integration.Tests/Tests.cs b/src/Verify.Integration.Tests/Tests.cs index 0cb45e31b8..559f1e75f7 100644 --- a/src/Verify.Integration.Tests/Tests.cs +++ b/src/Verify.Integration.Tests/Tests.cs @@ -1,9 +1,6 @@ #if DEBUG using DiffEngine; using EmptyFiles; -using VerifyTests; -using VerifyXunit; -using Xunit; [UsesVerify] public partial class Tests diff --git a/src/Verify.Integration.Tests/Tests_Single.cs b/src/Verify.Integration.Tests/Tests_Single.cs index 6f3297544f..b50f0d80de 100644 --- a/src/Verify.Integration.Tests/Tests_Single.cs +++ b/src/Verify.Integration.Tests/Tests_Single.cs @@ -1,8 +1,5 @@ #if DEBUG using DiffEngine; -using VerifyTests; -using VerifyXunit; -using Xunit; public partial class Tests { diff --git a/src/Verify.Integration.Tests/Tests_Split.cs b/src/Verify.Integration.Tests/Tests_Split.cs index f2d6a353a3..7380f1e35b 100644 --- a/src/Verify.Integration.Tests/Tests_Split.cs +++ b/src/Verify.Integration.Tests/Tests_Split.cs @@ -1,9 +1,6 @@ #if DEBUG using DiffEngine; -using VerifyTests; -using VerifyXunit; -using Xunit; public partial class Tests { diff --git a/src/Verify.Integration.Tests/Tests_SplitOneFail.cs b/src/Verify.Integration.Tests/Tests_SplitOneFail.cs index 9b6fd3fc2d..8e07569cda 100644 --- a/src/Verify.Integration.Tests/Tests_SplitOneFail.cs +++ b/src/Verify.Integration.Tests/Tests_SplitOneFail.cs @@ -1,9 +1,6 @@ #if DEBUG using DiffEngine; -using VerifyTests; -using VerifyXunit; -using Xunit; public partial class Tests { diff --git a/src/Verify.Integration.Tests/Verify.Integration.Tests.csproj b/src/Verify.Integration.Tests/Verify.Integration.Tests.csproj index ef6f5384e4..52ebb80476 100644 --- a/src/Verify.Integration.Tests/Verify.Integration.Tests.csproj +++ b/src/Verify.Integration.Tests/Verify.Integration.Tests.csproj @@ -14,4 +14,5 @@ + \ No newline at end of file diff --git a/src/Verify.MSTest.Tests/Inheritance/Base.cs b/src/Verify.MSTest.Tests/Inheritance/Base.cs index f530c85d5c..20877ba72c 100644 --- a/src/Verify.MSTest.Tests/Inheritance/Base.cs +++ b/src/Verify.MSTest.Tests/Inheritance/Base.cs @@ -1,7 +1,4 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using VerifyMSTest; - -namespace TheTests; +namespace TheTests; [TestClass] public class Base : diff --git a/src/Verify.MSTest.Tests/Inheritance/Inherited.cs b/src/Verify.MSTest.Tests/Inheritance/Inherited.cs index ad8c4b380f..4737110a65 100644 --- a/src/Verify.MSTest.Tests/Inheritance/Inherited.cs +++ b/src/Verify.MSTest.Tests/Inheritance/Inherited.cs @@ -1,6 +1,4 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace TheTests; +namespace TheTests; [TestClass] public class Inherited : Base diff --git a/src/Verify.MSTest.Tests/Scrubbers/ScrubberLevelsSample.cs b/src/Verify.MSTest.Tests/Scrubbers/ScrubberLevelsSample.cs index 87c848f15b..5579947a79 100644 --- a/src/Verify.MSTest.Tests/Scrubbers/ScrubberLevelsSample.cs +++ b/src/Verify.MSTest.Tests/Scrubbers/ScrubberLevelsSample.cs @@ -1,8 +1,4 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using VerifyTests; -using VerifyMSTest; - -namespace TheTests; +namespace TheTests; #region ScrubberLevelsSampleMSTest diff --git a/src/Verify.MSTest.Tests/Scrubbers/ScrubbersSample.cs b/src/Verify.MSTest.Tests/Scrubbers/ScrubbersSample.cs index ee508ddd99..dfd0e708b8 100644 --- a/src/Verify.MSTest.Tests/Scrubbers/ScrubbersSample.cs +++ b/src/Verify.MSTest.Tests/Scrubbers/ScrubbersSample.cs @@ -1,8 +1,4 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using VerifyTests; -using VerifyMSTest; - -namespace TheTests; +namespace TheTests; #region ScrubbersSampleMSTest diff --git a/src/Verify.MSTest.Tests/Snippets/ExtensionSample.cs b/src/Verify.MSTest.Tests/Snippets/ExtensionSample.cs index d05ace49d7..8fe57ed87b 100644 --- a/src/Verify.MSTest.Tests/Snippets/ExtensionSample.cs +++ b/src/Verify.MSTest.Tests/Snippets/ExtensionSample.cs @@ -1,8 +1,4 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using VerifyTests; -using VerifyMSTest; - -namespace TheTests; +namespace TheTests; #region MSTestExtensionSample diff --git a/src/Verify.MSTest.Tests/Snippets/ParametersSample.cs b/src/Verify.MSTest.Tests/Snippets/ParametersSample.cs index 57284d0f1b..d057f06ba3 100644 --- a/src/Verify.MSTest.Tests/Snippets/ParametersSample.cs +++ b/src/Verify.MSTest.Tests/Snippets/ParametersSample.cs @@ -1,8 +1,4 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using VerifyTests; -using VerifyMSTest; - -namespace TheTests; +namespace TheTests; #region MSTestDataRow diff --git a/src/Verify.MSTest.Tests/Snippets/ParametersTests.cs b/src/Verify.MSTest.Tests/Snippets/ParametersTests.cs index 97cd505f7d..e779dcdc5a 100644 --- a/src/Verify.MSTest.Tests/Snippets/ParametersTests.cs +++ b/src/Verify.MSTest.Tests/Snippets/ParametersTests.cs @@ -1,7 +1,4 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using VerifyMSTest; - -namespace TheTests; +namespace TheTests; [TestClass] public class ParametersTests : diff --git a/src/Verify.MSTest.Tests/Snippets/Sample.cs b/src/Verify.MSTest.Tests/Snippets/Sample.cs index e864e1be76..2e112c0a32 100644 --- a/src/Verify.MSTest.Tests/Snippets/Sample.cs +++ b/src/Verify.MSTest.Tests/Snippets/Sample.cs @@ -1,7 +1,4 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using VerifyMSTest; - -namespace TheTests; +namespace TheTests; #region SampleTestMSTest diff --git a/src/Verify.MSTest.Tests/Snippets/UniqueForSample.cs b/src/Verify.MSTest.Tests/Snippets/UniqueForSample.cs index c287ad416e..895318df4f 100644 --- a/src/Verify.MSTest.Tests/Snippets/UniqueForSample.cs +++ b/src/Verify.MSTest.Tests/Snippets/UniqueForSample.cs @@ -1,8 +1,4 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using VerifyMSTest; -using VerifyTests; - -namespace TheTests; +namespace TheTests; #region UniqueForSampleMSTest diff --git a/src/Verify.MSTest.Tests/Tests.cs b/src/Verify.MSTest.Tests/Tests.cs index 59dac2f8a9..9226d7e340 100644 --- a/src/Verify.MSTest.Tests/Tests.cs +++ b/src/Verify.MSTest.Tests/Tests.cs @@ -1,7 +1,4 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using VerifyMSTest; - -// remove namespace when https://github.com/microsoft/testfx/issues/889 +// remove namespace when https://github.com/microsoft/testfx/issues/889 namespace TheTests; [TestClass] diff --git a/src/Verify.MSTest.Tests/Verify.MSTest.Tests.csproj b/src/Verify.MSTest.Tests/Verify.MSTest.Tests.csproj index 2febd0538b..529b823100 100644 --- a/src/Verify.MSTest.Tests/Verify.MSTest.Tests.csproj +++ b/src/Verify.MSTest.Tests/Verify.MSTest.Tests.csproj @@ -20,4 +20,5 @@ + \ No newline at end of file diff --git a/src/Verify.MSTest.Tests/VerifyObjectSamples.cs b/src/Verify.MSTest.Tests/VerifyObjectSamples.cs index 364beb650e..9d7bed243b 100644 --- a/src/Verify.MSTest.Tests/VerifyObjectSamples.cs +++ b/src/Verify.MSTest.Tests/VerifyObjectSamples.cs @@ -1,7 +1,4 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Newtonsoft.Json; -using VerifyTests; -using VerifyMSTest; +using Newtonsoft.Json; namespace TheTests; // Non-nullable field is uninitialized diff --git a/src/Verify.MSTest.Tests/VerifyTextSample.cs b/src/Verify.MSTest.Tests/VerifyTextSample.cs index e1e0fbee25..ed8e7be161 100644 --- a/src/Verify.MSTest.Tests/VerifyTextSample.cs +++ b/src/Verify.MSTest.Tests/VerifyTextSample.cs @@ -1,7 +1,4 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using VerifyMSTest; - -namespace TheTests; +namespace TheTests; [TestClass] public class VerifyTextSample : diff --git a/src/Verify.MSTest/Verify.MSTest.csproj b/src/Verify.MSTest/Verify.MSTest.csproj index 5d002fb8b5..91f3ee40fe 100644 --- a/src/Verify.MSTest/Verify.MSTest.csproj +++ b/src/Verify.MSTest/Verify.MSTest.csproj @@ -6,11 +6,14 @@ netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1;net461;net472;net5;net6 + + + \ No newline at end of file diff --git a/src/Verify.MSTest/buildTransitive/Verify.MSTest.props b/src/Verify.MSTest/buildTransitive/Verify.MSTest.props new file mode 100644 index 0000000000..1d87e4de86 --- /dev/null +++ b/src/Verify.MSTest/buildTransitive/Verify.MSTest.props @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/Verify.NUnit.Tests/Inheritance/Base.cs b/src/Verify.NUnit.Tests/Inheritance/Base.cs index 771c6a53d9..0fa3c4a352 100644 --- a/src/Verify.NUnit.Tests/Inheritance/Base.cs +++ b/src/Verify.NUnit.Tests/Inheritance/Base.cs @@ -1,7 +1,4 @@ -using NUnit.Framework; -using VerifyNUnit; - -[TestFixture] +[TestFixture] public class Base { [Test] diff --git a/src/Verify.NUnit.Tests/Inheritance/Inherited.cs b/src/Verify.NUnit.Tests/Inheritance/Inherited.cs index 9c3844c0c2..41d1e4be58 100644 --- a/src/Verify.NUnit.Tests/Inheritance/Inherited.cs +++ b/src/Verify.NUnit.Tests/Inheritance/Inherited.cs @@ -1,6 +1,4 @@ -using NUnit.Framework; - -public class Inherited : Base +public class Inherited : Base { [Test] public override Task TestToOverride() diff --git a/src/Verify.NUnit.Tests/MisNamedTests.cs b/src/Verify.NUnit.Tests/MisNamedTests.cs index 3665292add..b0d1d1b2dd 100644 --- a/src/Verify.NUnit.Tests/MisNamedTests.cs +++ b/src/Verify.NUnit.Tests/MisNamedTests.cs @@ -1,7 +1,4 @@ -using NUnit.Framework; -using VerifyNUnit; - -[TestFixture] +[TestFixture] public class DiffNamedTests { [Test] diff --git a/src/Verify.NUnit.Tests/Scrubbers/ScrubberLevelsSample.cs b/src/Verify.NUnit.Tests/Scrubbers/ScrubberLevelsSample.cs index 1d4bd76431..182c3ad8d6 100644 --- a/src/Verify.NUnit.Tests/Scrubbers/ScrubberLevelsSample.cs +++ b/src/Verify.NUnit.Tests/Scrubbers/ScrubberLevelsSample.cs @@ -1,8 +1,4 @@ -using NUnit.Framework; -using VerifyNUnit; -using VerifyTests; - -#region ScrubberLevelsSampleNUnit +#region ScrubberLevelsSampleNUnit [TestFixture] public class ScrubberLevelsSample diff --git a/src/Verify.NUnit.Tests/Scrubbers/ScrubbersSample.cs b/src/Verify.NUnit.Tests/Scrubbers/ScrubbersSample.cs index 3f33689e0a..c6c1a84766 100644 --- a/src/Verify.NUnit.Tests/Scrubbers/ScrubbersSample.cs +++ b/src/Verify.NUnit.Tests/Scrubbers/ScrubbersSample.cs @@ -1,8 +1,4 @@ -using NUnit.Framework; -using VerifyNUnit; -using VerifyTests; - -#region ScrubbersSampleNUnit +#region ScrubbersSampleNUnit [TestFixture] public class ScrubbersSample diff --git a/src/Verify.NUnit.Tests/Snippets/ExtensionSample.cs b/src/Verify.NUnit.Tests/Snippets/ExtensionSample.cs index e7e0cf96b7..cec748676f 100644 --- a/src/Verify.NUnit.Tests/Snippets/ExtensionSample.cs +++ b/src/Verify.NUnit.Tests/Snippets/ExtensionSample.cs @@ -1,7 +1,4 @@ -using NUnit.Framework; -using VerifyNUnit; -using VerifyTests; -#region NUnitExtensionSample +#region NUnitExtensionSample [TestFixture] public class ExtensionSample { diff --git a/src/Verify.NUnit.Tests/Snippets/ParametersSample.cs b/src/Verify.NUnit.Tests/Snippets/ParametersSample.cs index 094a78faac..8761a2f69d 100644 --- a/src/Verify.NUnit.Tests/Snippets/ParametersSample.cs +++ b/src/Verify.NUnit.Tests/Snippets/ParametersSample.cs @@ -1,7 +1,4 @@ -using NUnit.Framework; -using VerifyNUnit; - -[TestFixture] +[TestFixture] public class ParametersSample { [TestCase("1.1")] diff --git a/src/Verify.NUnit.Tests/Snippets/Sample.cs b/src/Verify.NUnit.Tests/Snippets/Sample.cs index e85a93e1ec..d2969c2c3f 100644 --- a/src/Verify.NUnit.Tests/Snippets/Sample.cs +++ b/src/Verify.NUnit.Tests/Snippets/Sample.cs @@ -1,7 +1,4 @@ -using NUnit.Framework; -using VerifyNUnit; - -#region SampleTestNUnit +#region SampleTestNUnit [TestFixture] public class Sample diff --git a/src/Verify.NUnit.Tests/Snippets/UniqueForSample.cs b/src/Verify.NUnit.Tests/Snippets/UniqueForSample.cs index cf36cc7abc..35111b2cc0 100644 --- a/src/Verify.NUnit.Tests/Snippets/UniqueForSample.cs +++ b/src/Verify.NUnit.Tests/Snippets/UniqueForSample.cs @@ -1,8 +1,4 @@ -using NUnit.Framework; -using VerifyNUnit; -using VerifyTests; - -#region UniqueForSampleNUnit +#region UniqueForSampleNUnit [TestFixture] public class UniqueForSample diff --git a/src/Verify.NUnit.Tests/Tests.cs b/src/Verify.NUnit.Tests/Tests.cs index 76f8044cf7..a455c9cc30 100644 --- a/src/Verify.NUnit.Tests/Tests.cs +++ b/src/Verify.NUnit.Tests/Tests.cs @@ -1,7 +1,4 @@ -using NUnit.Framework; -using VerifyNUnit; - -[TestFixture] +[TestFixture] public class Tests { [TestCase("Value1")] diff --git a/src/Verify.NUnit.Tests/Verify.NUnit.Tests.csproj b/src/Verify.NUnit.Tests/Verify.NUnit.Tests.csproj index 7e040ab54c..a1838e07fa 100644 --- a/src/Verify.NUnit.Tests/Verify.NUnit.Tests.csproj +++ b/src/Verify.NUnit.Tests/Verify.NUnit.Tests.csproj @@ -19,4 +19,5 @@ + \ No newline at end of file diff --git a/src/Verify.NUnit.Tests/VerifyObjectSamples.cs b/src/Verify.NUnit.Tests/VerifyObjectSamples.cs index 8b26fcf7ef..a007f345da 100644 --- a/src/Verify.NUnit.Tests/VerifyObjectSamples.cs +++ b/src/Verify.NUnit.Tests/VerifyObjectSamples.cs @@ -1,7 +1,4 @@ using Newtonsoft.Json; -using NUnit.Framework; -using VerifyTests; -using VerifyNUnit; // Non-nullable field is uninitialized #pragma warning disable CS8618 diff --git a/src/Verify.NUnit.Tests/VerifyTextSample.cs b/src/Verify.NUnit.Tests/VerifyTextSample.cs index 5a9a20c2b3..f928c6d3f9 100644 --- a/src/Verify.NUnit.Tests/VerifyTextSample.cs +++ b/src/Verify.NUnit.Tests/VerifyTextSample.cs @@ -1,7 +1,4 @@ -using NUnit.Framework; -using VerifyNUnit; - -[TestFixture] +[TestFixture] public class VerifyTextSample { [Test] diff --git a/src/Verify.NUnit/Verify.NUnit.csproj b/src/Verify.NUnit/Verify.NUnit.csproj index e191adf55e..9676f0989e 100644 --- a/src/Verify.NUnit/Verify.NUnit.csproj +++ b/src/Verify.NUnit/Verify.NUnit.csproj @@ -6,11 +6,14 @@ netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1;net461;net472;net5;net6 + + + \ No newline at end of file diff --git a/src/Verify.NUnit/buildTransitive/Verify.NUnit.props b/src/Verify.NUnit/buildTransitive/Verify.NUnit.props new file mode 100644 index 0000000000..15c5f7121f --- /dev/null +++ b/src/Verify.NUnit/buildTransitive/Verify.NUnit.props @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/Verify.Tests/AttributeReaderTests.cs b/src/Verify.Tests/AttributeReaderTests.cs index 03274a0433..22d267d4d4 100644 --- a/src/Verify.Tests/AttributeReaderTests.cs +++ b/src/Verify.Tests/AttributeReaderTests.cs @@ -1,8 +1,4 @@ -using VerifyTests; -using VerifyXunit; -using Xunit; - -[UsesVerify] +[UsesVerify] public class AttributeReaderTests { [Fact] diff --git a/src/Verify.Tests/ClipboardEnabledTests.cs b/src/Verify.Tests/ClipboardEnabledTests.cs index 0526456285..e41f2655af 100644 --- a/src/Verify.Tests/ClipboardEnabledTests.cs +++ b/src/Verify.Tests/ClipboardEnabledTests.cs @@ -1,7 +1,4 @@ -using VerifyXunit; -using Xunit; - -[UsesVerify] +[UsesVerify] public class ClipboardEnabledTests { [Fact] diff --git a/src/Verify.Tests/Comparer/ComparerTests.cs b/src/Verify.Tests/Comparer/ComparerTests.cs index 925e930053..619fd34333 100644 --- a/src/Verify.Tests/Comparer/ComparerTests.cs +++ b/src/Verify.Tests/Comparer/ComparerTests.cs @@ -1,8 +1,4 @@ -using VerifyTests; -using VerifyXunit; -using Xunit; - -[UsesVerify] +[UsesVerify] public class ComparerTests { [Fact] diff --git a/src/Verify.Tests/Converters/ExtensionConverterTests.cs b/src/Verify.Tests/Converters/ExtensionConverterTests.cs index f784cc1c5a..46779f5ed8 100644 --- a/src/Verify.Tests/Converters/ExtensionConverterTests.cs +++ b/src/Verify.Tests/Converters/ExtensionConverterTests.cs @@ -1,8 +1,4 @@ -using VerifyTests; -using VerifyXunit; -using Xunit; - -[UsesVerify] +[UsesVerify] public class ExtensionConverterTests { [ModuleInitializer] diff --git a/src/Verify.Tests/Converters/FileAppenderTests.cs b/src/Verify.Tests/Converters/FileAppenderTests.cs index dda7e5f1b7..dba63d99be 100644 --- a/src/Verify.Tests/Converters/FileAppenderTests.cs +++ b/src/Verify.Tests/Converters/FileAppenderTests.cs @@ -1,8 +1,4 @@ -using VerifyTests; -using VerifyXunit; -using Xunit; - -[UsesVerify] +[UsesVerify] public class FileAppenderTests : IDisposable { diff --git a/src/Verify.Tests/Converters/JsonAppenderTests.cs b/src/Verify.Tests/Converters/JsonAppenderTests.cs index 14af56a8ae..593a22d4d5 100644 --- a/src/Verify.Tests/Converters/JsonAppenderTests.cs +++ b/src/Verify.Tests/Converters/JsonAppenderTests.cs @@ -1,8 +1,4 @@ -using VerifyTests; -using VerifyXunit; -using Xunit; - -[UsesVerify] +[UsesVerify] public class JsonAppenderTests : IDisposable { static AsyncLocal isInThisTest = new(); diff --git a/src/Verify.Tests/Converters/TypeConverterTests.cs b/src/Verify.Tests/Converters/TypeConverterTests.cs index ea52331b6f..61562968cd 100644 --- a/src/Verify.Tests/Converters/TypeConverterTests.cs +++ b/src/Verify.Tests/Converters/TypeConverterTests.cs @@ -1,7 +1,4 @@ #if NET6_0 && DEBUG -using VerifyTests; -using VerifyXunit; -using Xunit; using System.Drawing; using System.Drawing.Imaging; diff --git a/src/Verify.Tests/FileComparerTests.cs b/src/Verify.Tests/FileComparerTests.cs index 3f0e538e00..2d2c8a04a8 100644 --- a/src/Verify.Tests/FileComparerTests.cs +++ b/src/Verify.Tests/FileComparerTests.cs @@ -1,6 +1,4 @@ -using Xunit; - -public class FileComparerTests +public class FileComparerTests { [Fact] public async Task BinaryEquals() diff --git a/src/Verify.Tests/FileHelperTests.cs b/src/Verify.Tests/FileHelperTests.cs index b995672a1a..e5145c18ae 100644 --- a/src/Verify.Tests/FileHelperTests.cs +++ b/src/Verify.Tests/FileHelperTests.cs @@ -1,6 +1,4 @@ -using Xunit; - -public class FileHelperTests +public class FileHelperTests { [Fact] public void ShouldNotLock() diff --git a/src/Verify.Tests/LinesScrubberTests.cs b/src/Verify.Tests/LinesScrubberTests.cs index eb2c9345ed..4cd844ade4 100644 --- a/src/Verify.Tests/LinesScrubberTests.cs +++ b/src/Verify.Tests/LinesScrubberTests.cs @@ -1,8 +1,4 @@ -using VerifyTests; -using VerifyXunit; -using Xunit; - -[UsesVerify] +[UsesVerify] public class LinesScrubberTests { [Fact] diff --git a/src/Verify.Tests/Naming/NamerInNamespaceTests.cs b/src/Verify.Tests/Naming/NamerInNamespaceTests.cs index 915a667e48..9436c9c996 100644 --- a/src/Verify.Tests/Naming/NamerInNamespaceTests.cs +++ b/src/Verify.Tests/Naming/NamerInNamespaceTests.cs @@ -1,7 +1,4 @@ -using VerifyXunit; -using Xunit; - -namespace TheNamespace.Bar; +namespace TheNamespace.Bar; [UsesVerify] public class NamerInNamespaceTests diff --git a/src/Verify.Tests/Naming/NamerTests.cs b/src/Verify.Tests/Naming/NamerTests.cs index fe6d8e13a9..0275bbc480 100644 --- a/src/Verify.Tests/Naming/NamerTests.cs +++ b/src/Verify.Tests/Naming/NamerTests.cs @@ -1,8 +1,4 @@ -using VerifyTests; -using VerifyXunit; -using Xunit; - -[UsesVerify] +[UsesVerify] public class NamerTests { #if NET6_0 && DEBUG diff --git a/src/Verify.Tests/ScrubStackTrace.cs b/src/Verify.Tests/ScrubStackTrace.cs index 6369c81ce9..c7f1dc2546 100644 --- a/src/Verify.Tests/ScrubStackTrace.cs +++ b/src/Verify.Tests/ScrubStackTrace.cs @@ -1,8 +1,4 @@ -using VerifyTests; -using VerifyXunit; -using Xunit; - -[UsesVerify] +[UsesVerify] public class ScrubStackTrace { [Fact] diff --git a/src/Verify.Tests/Serialization/SerializationTests.cs b/src/Verify.Tests/Serialization/SerializationTests.cs index cba11145dd..9df3dc7f0b 100644 --- a/src/Verify.Tests/Serialization/SerializationTests.cs +++ b/src/Verify.Tests/Serialization/SerializationTests.cs @@ -1,9 +1,6 @@ using System.Collections.Specialized; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using VerifyTests; -using VerifyXunit; -using Xunit; #if !NET461 using System.Linq.Expressions; using System.Security.Claims; diff --git a/src/Verify.Tests/SimpleTypeTests.cs b/src/Verify.Tests/SimpleTypeTests.cs index 459e3a529d..aa738c5de1 100644 --- a/src/Verify.Tests/SimpleTypeTests.cs +++ b/src/Verify.Tests/SimpleTypeTests.cs @@ -1,11 +1,6 @@ using System.Xml; using System.Xml.Linq; using Newtonsoft.Json.Linq; -using VerifyXunit; -using Xunit; -#if NET5_0_OR_GREATER -using VerifyTests; -#endif [UsesVerify] public class SimpleTypeTests diff --git a/src/Verify.Tests/Snippets/ComparerSnippets.cs b/src/Verify.Tests/Snippets/ComparerSnippets.cs index 24cb38ed7a..89e40b67bf 100644 --- a/src/Verify.Tests/Snippets/ComparerSnippets.cs +++ b/src/Verify.Tests/Snippets/ComparerSnippets.cs @@ -1,7 +1,4 @@ #if DEBUG -using VerifyTests; -using VerifyXunit; -using Xunit; [UsesVerify] public class ComparerSnippets diff --git a/src/Verify.Tests/Snippets/ConverterSnippets.cs b/src/Verify.Tests/Snippets/ConverterSnippets.cs index d528123d7a..da9d0f28bf 100644 --- a/src/Verify.Tests/Snippets/ConverterSnippets.cs +++ b/src/Verify.Tests/Snippets/ConverterSnippets.cs @@ -1,9 +1,6 @@ #if DEBUG && NET6_0 using System.Drawing; using System.Drawing.Imaging; -using VerifyTests; -using VerifyXunit; -using Xunit; // ReSharper disable UnusedParameter.Local [UsesVerify] diff --git a/src/Verify.Tests/Snippets/Snippets.cs b/src/Verify.Tests/Snippets/Snippets.cs index 51a209f3a9..5dec34be47 100644 --- a/src/Verify.Tests/Snippets/Snippets.cs +++ b/src/Verify.Tests/Snippets/Snippets.cs @@ -1,7 +1,5 @@ using DiffEngine; using Newtonsoft.Json; -using VerifyTests; -using VerifyXunit; // ReSharper disable UnusedParameter.Local public class Snippets diff --git a/src/Verify.Tests/StaticSettings.cs b/src/Verify.Tests/StaticSettings.cs index 9dad7a0c13..3defca3ad7 100644 --- a/src/Verify.Tests/StaticSettings.cs +++ b/src/Verify.Tests/StaticSettings.cs @@ -1,8 +1,4 @@ -using VerifyTests; -using VerifyXunit; -using Xunit; - -[UsesVerify] +[UsesVerify] public class StaticSettings { [Fact] diff --git a/src/Verify.Tests/Tests.cs b/src/Verify.Tests/Tests.cs index edeb28b09e..9c84cce93e 100644 --- a/src/Verify.Tests/Tests.cs +++ b/src/Verify.Tests/Tests.cs @@ -1,8 +1,4 @@ using System.Globalization; -using VerifyTests; -using VerifyXunit; -using Xunit; - // Non-nullable field is uninitialized. #pragma warning disable CS8618 diff --git a/src/Verify.Tests/Verify.Tests.csproj b/src/Verify.Tests/Verify.Tests.csproj index 0282d1e622..3093e7ab6e 100644 --- a/src/Verify.Tests/Verify.Tests.csproj +++ b/src/Verify.Tests/Verify.Tests.csproj @@ -31,4 +31,5 @@ + \ No newline at end of file diff --git a/src/Verify.Tests/VerifySettingsTests.cs b/src/Verify.Tests/VerifySettingsTests.cs index 468b13ee76..d23713cbfd 100644 --- a/src/Verify.Tests/VerifySettingsTests.cs +++ b/src/Verify.Tests/VerifySettingsTests.cs @@ -1,7 +1,4 @@ -using VerifyTests; -using Xunit; - -public class VerifySettingsTests +public class VerifySettingsTests { [Fact] public void ContextIsCloned() diff --git a/src/Verify.Xunit.Tests/Inheritance/Base.cs b/src/Verify.Xunit.Tests/Inheritance/Base.cs index 3683fcdf0b..0d7ddaf5df 100644 --- a/src/Verify.Xunit.Tests/Inheritance/Base.cs +++ b/src/Verify.Xunit.Tests/Inheritance/Base.cs @@ -1,7 +1,4 @@ -using VerifyXunit; -using Xunit; - -[UsesVerify] +[UsesVerify] public class Base { [Fact] diff --git a/src/Verify.Xunit.Tests/Inheritance/Inherited.cs b/src/Verify.Xunit.Tests/Inheritance/Inherited.cs index 71948f6036..847f145359 100644 --- a/src/Verify.Xunit.Tests/Inheritance/Inherited.cs +++ b/src/Verify.Xunit.Tests/Inheritance/Inherited.cs @@ -1,6 +1,4 @@ -using VerifyXunit; - -[UsesVerify] +[UsesVerify] public class Inherited : Base { public override Task TestToOverride() diff --git a/src/Verify.Xunit.Tests/MisNamedTests.cs b/src/Verify.Xunit.Tests/MisNamedTests.cs index 9f381c9b87..0640a5f081 100644 --- a/src/Verify.Xunit.Tests/MisNamedTests.cs +++ b/src/Verify.Xunit.Tests/MisNamedTests.cs @@ -1,7 +1,4 @@ -using VerifyXunit; -using Xunit; - -public class NoAttributeTests +public class NoAttributeTests { [Fact] public async Task ShouldThrow() diff --git a/src/Verify.Xunit.Tests/ModuleInitializerAttribute.cs b/src/Verify.Xunit.Tests/ModuleInitializerAttribute.cs index c6baf0b995..e7297382ed 100644 --- a/src/Verify.Xunit.Tests/ModuleInitializerAttribute.cs +++ b/src/Verify.Xunit.Tests/ModuleInitializerAttribute.cs @@ -1,9 +1,8 @@ #if(!NET5_0_OR_GREATER) -namespace System.Runtime.CompilerServices +namespace System.Runtime.CompilerServices; + +[AttributeUsage(AttributeTargets.Method, Inherited = false)] +sealed class ModuleInitializerAttribute : Attribute { - [AttributeUsage(AttributeTargets.Method, Inherited = false)] - sealed class ModuleInitializerAttribute : Attribute - { - } } #endif \ No newline at end of file diff --git a/src/Verify.Xunit.Tests/Scrubbers/ScrubberLevelsSample.cs b/src/Verify.Xunit.Tests/Scrubbers/ScrubberLevelsSample.cs index 482a889d90..4037b143b7 100644 --- a/src/Verify.Xunit.Tests/Scrubbers/ScrubberLevelsSample.cs +++ b/src/Verify.Xunit.Tests/Scrubbers/ScrubberLevelsSample.cs @@ -1,8 +1,4 @@ -using VerifyTests; -using VerifyXunit; -using Xunit; - -#region ScrubberLevelsSampleXunit +#region ScrubberLevelsSampleXunit [UsesVerify] public class ScrubberLevelsSample diff --git a/src/Verify.Xunit.Tests/Scrubbers/ScrubbersSample.cs b/src/Verify.Xunit.Tests/Scrubbers/ScrubbersSample.cs index df6fb7fbd4..573d7d4f84 100644 --- a/src/Verify.Xunit.Tests/Scrubbers/ScrubbersSample.cs +++ b/src/Verify.Xunit.Tests/Scrubbers/ScrubbersSample.cs @@ -1,8 +1,4 @@ -using VerifyTests; -using VerifyXunit; -using Xunit; - -#region ScrubbersSampleXunit +#region ScrubbersSampleXunit [UsesVerify] public class ScrubbersSample diff --git a/src/Verify.Xunit.Tests/Snippets/CompareToAssert.cs b/src/Verify.Xunit.Tests/Snippets/CompareToAssert.cs index 168aa3c8e8..9d528c015f 100644 --- a/src/Verify.Xunit.Tests/Snippets/CompareToAssert.cs +++ b/src/Verify.Xunit.Tests/Snippets/CompareToAssert.cs @@ -1,7 +1,4 @@ -using VerifyXunit; -using Xunit; - -[UsesVerify] +[UsesVerify] public class CompareToAssert { #region TraditionalTest diff --git a/src/Verify.Xunit.Tests/Snippets/ComplexParametersSample.cs b/src/Verify.Xunit.Tests/Snippets/ComplexParametersSample.cs index 675ef4458b..4802a79f42 100644 --- a/src/Verify.Xunit.Tests/Snippets/ComplexParametersSample.cs +++ b/src/Verify.Xunit.Tests/Snippets/ComplexParametersSample.cs @@ -1,8 +1,4 @@ -using VerifyTests; -using VerifyXunit; -using Xunit; - -#region xunitComplexMemberData +#region xunitComplexMemberData [UsesVerify] public class ComplexParametersSample { diff --git a/src/Verify.Xunit.Tests/Snippets/ExtensionSample.cs b/src/Verify.Xunit.Tests/Snippets/ExtensionSample.cs index 130817fc60..6fe3d688db 100644 --- a/src/Verify.Xunit.Tests/Snippets/ExtensionSample.cs +++ b/src/Verify.Xunit.Tests/Snippets/ExtensionSample.cs @@ -1,8 +1,4 @@ -using VerifyTests; -using VerifyXunit; -using Xunit; - -#region XunitExtensionSample +#region XunitExtensionSample [UsesVerify] public class ExtensionSample diff --git a/src/Verify.Xunit.Tests/Snippets/ParametersSample.cs b/src/Verify.Xunit.Tests/Snippets/ParametersSample.cs index e866acdbde..58730f522d 100644 --- a/src/Verify.Xunit.Tests/Snippets/ParametersSample.cs +++ b/src/Verify.Xunit.Tests/Snippets/ParametersSample.cs @@ -1,8 +1,4 @@ -using VerifyTests; -using VerifyXunit; -using Xunit; - -[UsesVerify] +[UsesVerify] public class ParametersSample { public static IEnumerable GetDecimalData() diff --git a/src/Verify.Xunit.Tests/Snippets/Sample.cs b/src/Verify.Xunit.Tests/Snippets/Sample.cs index b3138c5b92..ed0325fd84 100644 --- a/src/Verify.Xunit.Tests/Snippets/Sample.cs +++ b/src/Verify.Xunit.Tests/Snippets/Sample.cs @@ -1,7 +1,4 @@ -using VerifyXunit; -using Xunit; - -#region SampleTestXunit +#region SampleTestXunit [UsesVerify] public class Sample diff --git a/src/Verify.Xunit.Tests/Snippets/UniqueForSample.cs b/src/Verify.Xunit.Tests/Snippets/UniqueForSample.cs index 256620a4e6..4b512899b1 100644 --- a/src/Verify.Xunit.Tests/Snippets/UniqueForSample.cs +++ b/src/Verify.Xunit.Tests/Snippets/UniqueForSample.cs @@ -1,8 +1,4 @@ -using VerifyTests; -using VerifyXunit; -using Xunit; - -#region UniqueForSampleXunit +#region UniqueForSampleXunit [UsesVerify] public class UniqueForSample diff --git a/src/Verify.Xunit.Tests/Tests.cs b/src/Verify.Xunit.Tests/Tests.cs index 0518ab2eba..a0f4cdc4cc 100644 --- a/src/Verify.Xunit.Tests/Tests.cs +++ b/src/Verify.Xunit.Tests/Tests.cs @@ -1,7 +1,4 @@ -using VerifyXunit; -using Xunit; - -[UsesVerify] +[UsesVerify] public class Tests { [Theory] diff --git a/src/Verify.Xunit.Tests/Verify.Xunit.Tests.csproj b/src/Verify.Xunit.Tests/Verify.Xunit.Tests.csproj index 5dbf0a8d74..91eaa09a7b 100644 --- a/src/Verify.Xunit.Tests/Verify.Xunit.Tests.csproj +++ b/src/Verify.Xunit.Tests/Verify.Xunit.Tests.csproj @@ -22,4 +22,5 @@ + \ No newline at end of file diff --git a/src/Verify.Xunit.Tests/VerifyObjectSamples.cs b/src/Verify.Xunit.Tests/VerifyObjectSamples.cs index 0f695eb39d..a916b9d176 100644 --- a/src/Verify.Xunit.Tests/VerifyObjectSamples.cs +++ b/src/Verify.Xunit.Tests/VerifyObjectSamples.cs @@ -1,7 +1,4 @@ using Newtonsoft.Json; -using VerifyTests; -using VerifyXunit; -using Xunit; // Non-nullable field is uninitialized #pragma warning disable CS8618 diff --git a/src/Verify.Xunit.Tests/VerifyTextSample.cs b/src/Verify.Xunit.Tests/VerifyTextSample.cs index 6d220d05b3..ed7dfc0209 100644 --- a/src/Verify.Xunit.Tests/VerifyTextSample.cs +++ b/src/Verify.Xunit.Tests/VerifyTextSample.cs @@ -1,7 +1,4 @@ -using VerifyXunit; -using Xunit; - -[UsesVerify] +[UsesVerify] public class VerifyTextSample { [Fact] diff --git a/src/Verify.Xunit.Tests/WithAttributeTests.cs b/src/Verify.Xunit.Tests/WithAttributeTests.cs index 0a408acb34..86436d5037 100644 --- a/src/Verify.Xunit.Tests/WithAttributeTests.cs +++ b/src/Verify.Xunit.Tests/WithAttributeTests.cs @@ -1,7 +1,4 @@ -using VerifyXunit; -using Xunit; - -[UsesVerify] +[UsesVerify] public class WithAttributeTests { [Fact] diff --git a/src/Verify.Xunit/Verify.Xunit.csproj b/src/Verify.Xunit/Verify.Xunit.csproj index 7b86c5ba00..83adc2ef21 100644 --- a/src/Verify.Xunit/Verify.Xunit.csproj +++ b/src/Verify.Xunit/Verify.Xunit.csproj @@ -6,6 +6,7 @@ netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1;net461;net472;net5;net6 + @@ -14,5 +15,7 @@ + + \ No newline at end of file diff --git a/src/Verify.Xunit/buildTransitive/Verify.Xunit.props b/src/Verify.Xunit/buildTransitive/Verify.Xunit.props new file mode 100644 index 0000000000..ce534711ef --- /dev/null +++ b/src/Verify.Xunit/buildTransitive/Verify.Xunit.props @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/Verify/ModuleInitializerAttribute.cs b/src/Verify/ModuleInitializerAttribute.cs index c6baf0b995..e7297382ed 100644 --- a/src/Verify/ModuleInitializerAttribute.cs +++ b/src/Verify/ModuleInitializerAttribute.cs @@ -1,9 +1,8 @@ #if(!NET5_0_OR_GREATER) -namespace System.Runtime.CompilerServices +namespace System.Runtime.CompilerServices; + +[AttributeUsage(AttributeTargets.Method, Inherited = false)] +sealed class ModuleInitializerAttribute : Attribute { - [AttributeUsage(AttributeTargets.Method, Inherited = false)] - sealed class ModuleInitializerAttribute : Attribute - { - } } #endif \ No newline at end of file diff --git a/src/Verify/Verify.csproj b/src/Verify/Verify.csproj index 9dea0f7094..3957ce174f 100644 --- a/src/Verify/Verify.csproj +++ b/src/Verify/Verify.csproj @@ -6,6 +6,7 @@ netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1;net461;net472;net5;net6 + diff --git a/src/Verify/buildTransitive/Verify.props b/src/Verify/buildTransitive/Verify.props index e4f3a77208..cee33e0094 100644 --- a/src/Verify/buildTransitive/Verify.props +++ b/src/Verify/buildTransitive/Verify.props @@ -34,4 +34,7 @@ - + + + + \ No newline at end of file