-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d4e610
commit ca82a7b
Showing
165 changed files
with
1,925 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/Verify.TUnit.DerivePaths.Tests/CustomDir/CustomTypeName.CustomMethodName.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Value |
1 change: 1 addition & 0 deletions
1
src/Verify.TUnit.DerivePaths.Tests/Relative/Tests.ProjectRelativeDirectory.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Value |
1 change: 1 addition & 0 deletions
1
src/Verify.TUnit.DerivePaths.Tests/Relative/Tests.SourceFileRelativeDirectory.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Value |
1 change: 1 addition & 0 deletions
1
src/Verify.TUnit.DerivePaths.Tests/Tests.ReturnNulls.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Value |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
public class Tests | ||
{ | ||
[Test] | ||
public Task Test() | ||
{ | ||
DerivePathInfo( | ||
(sourceFile, projectDirectory, methodName, typeName) => | ||
{ | ||
Check(sourceFile, projectDirectory, methodName, typeName).GetAwaiter().GetResult(); | ||
return new("CustomDir", "CustomTypeName", "CustomMethodName"); | ||
}); | ||
return Verify("Value"); | ||
} | ||
|
||
static async Task Check(string sourceFile, string projectDirectory, Type methodName, MethodInfo typeName) | ||
{ | ||
await Assert.That(File.Exists(sourceFile)).IsTrue(); | ||
await Assert.That(Directory.Exists(projectDirectory)).IsTrue(); | ||
await Assert.That(methodName).IsNotNull(); | ||
await Assert.That(typeName).IsNotNull(); | ||
} | ||
|
||
[Test] | ||
public Task ReturnNulls() | ||
{ | ||
DerivePathInfo((_, _, _, _) => new(null)); | ||
return Verify("Value"); | ||
} | ||
|
||
[Test] | ||
public Task ProjectRelativeDirectory() | ||
{ | ||
UseProjectRelativeDirectory("Relative"); | ||
return Verify("Value"); | ||
} | ||
|
||
[Test] | ||
public Task SourceFileRelativeDirectory() | ||
{ | ||
UseSourceFileRelativeDirectory("Relative"); | ||
return Verify("Value"); | ||
} | ||
|
||
[Test] | ||
public async Task InvalidMethod() | ||
{ | ||
DerivePathInfo((_, _, _, _) => new(null, null, Path | ||
.GetInvalidFileNameChars() | ||
.First() | ||
.ToString())); | ||
await Assert.ThrowsAsync<ArgumentException>(() => Verify("Value")); | ||
} | ||
|
||
[Test] | ||
public async Task InvalidType() | ||
{ | ||
DerivePathInfo((_, _, _, _) => new(null, Path | ||
.GetInvalidFileNameChars() | ||
.First() | ||
.ToString())); | ||
await Assert.ThrowsAsync<ArgumentException>(() => Verify("Value")); | ||
} | ||
|
||
[Test] | ||
public async Task InvalidDirectory() | ||
{ | ||
DerivePathInfo((_, _, _, _) => new(Path | ||
.GetInvalidPathChars() | ||
.First() | ||
.ToString())); | ||
await Assert.ThrowsAsync<ArgumentException>(() => Verify("Value")); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/Verify.TUnit.DerivePaths.Tests/Verify.TUnit.DerivePaths.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net9.0</TargetFramework> | ||
<SignAssembly>false</SignAssembly> | ||
<NoWarn>$(NoWarn);CA1822</NoWarn> | ||
<OutputType>Exe</OutputType> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="ProjectDefaults" PrivateAssets="all" /> | ||
<PackageReference Include="TUnit" /> | ||
<ProjectReference Include="..\Verify.TUnit\Verify.TUnit.csproj" /> | ||
<ProjectReference Include="..\Verify\Verify.csproj" /> | ||
</ItemGroup> | ||
<Import Project="$(ProjectDir)..\Verify\buildTransitive\Verify.props" /> | ||
<Import Project="$(ProjectDir)..\Verify\buildTransitive\Verify.targets" /> | ||
<Import Project="$(ProjectDir)..\Verify.TUnit\buildTransitive\Verify.TUnit.props" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Global using directives | ||
|
||
global using Argon; |
1 change: 1 addition & 0 deletions
1
src/Verify.TUnit.Tests/Inheritance/Base.TestInBase.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Foo |
1 change: 1 addition & 0 deletions
1
src/Verify.TUnit.Tests/Inheritance/Base.TestToOverride.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
public class Base | ||
{ | ||
[Test] | ||
public Task TestInBase() => | ||
Verify("Foo"); | ||
|
||
[Test] | ||
public virtual Task TestToOverride() => | ||
Verify("Foo"); | ||
} |
1 change: 1 addition & 0 deletions
1
src/Verify.TUnit.Tests/Inheritance/Inherited.TestInBase.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Foo |
1 change: 1 addition & 0 deletions
1
src/Verify.TUnit.Tests/Inheritance/Inherited.TestToOverride.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[InheritsTests] | ||
public class Inherited : Base | ||
{ | ||
[Test] | ||
public override Task TestToOverride() | ||
{ | ||
Trace.WriteLine(""); | ||
return base.TestToOverride(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
public class DiffNamedTests | ||
{ | ||
[Test] | ||
public Task ShouldPass() => | ||
Verify("Foo"); | ||
} |
1 change: 1 addition & 0 deletions
1
src/Verify.TUnit.Tests/NestedTypeTests.Nested.ShouldPass.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
NestedFoo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
public class NestedTypeTests | ||
{ | ||
[Test] | ||
public Task ShouldPass() => | ||
Verify("Foo"); | ||
|
||
public class Nested | ||
{ | ||
[Test] | ||
public Task ShouldPass() => | ||
Verify("NestedFoo"); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
src/Verify.TUnit.Tests/Scrubbers/ScrubberLevelsSample.Simple.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
A B C |
1 change: 1 addition & 0 deletions
1
src/Verify.TUnit.Tests/Scrubbers/ScrubberLevelsSample.SimpleFluent.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
A B C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#region ScrubberLevelsSampleTUnit | ||
|
||
public class ScrubberLevelsSample | ||
{ | ||
VerifySettings classLevelSettings; | ||
|
||
public ScrubberLevelsSample() | ||
{ | ||
classLevelSettings = new(); | ||
classLevelSettings.AddScrubber(_ => _.Replace("Three", "C")); | ||
} | ||
|
||
[Test] | ||
public Task Simple() | ||
{ | ||
var settings = new VerifySettings(classLevelSettings); | ||
settings.AddScrubber(_ => _.Replace("Two", "B")); | ||
return Verify("One Two Three", settings); | ||
} | ||
|
||
[Test] | ||
public Task SimpleFluent() => | ||
Verify("One Two Three", classLevelSettings) | ||
.AddScrubber(_ => _.Replace("Two", "B")); | ||
|
||
[ModuleInitializer] | ||
public static void Setup() => | ||
VerifierSettings.AddScrubber(_ => _.Replace("One", "A")); | ||
} | ||
|
||
#endregion |
3 changes: 3 additions & 0 deletions
3
src/Verify.TUnit.Tests/Scrubbers/ScrubbersSample.AfterSerialization.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
RowVersion: TheRowVersion | ||
} |
3 changes: 3 additions & 0 deletions
3
src/Verify.TUnit.Tests/Scrubbers/ScrubbersSample.AfterSerializationFluent.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
RowVersion: TheRowVersion | ||
} |
2 changes: 2 additions & 0 deletions
2
src/Verify.TUnit.Tests/Scrubbers/ScrubbersSample.EmptyLines.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
LineA | ||
LineC |
4 changes: 4 additions & 0 deletions
4
src/Verify.TUnit.Tests/Scrubbers/ScrubbersSample.Lines.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
LineA | ||
LineC | ||
NoMoreLineE | ||
LineI |
4 changes: 4 additions & 0 deletions
4
src/Verify.TUnit.Tests/Scrubbers/ScrubbersSample.LinesFluent.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
LineA | ||
LineC | ||
NoMoreLineE | ||
LineI |
2 changes: 2 additions & 0 deletions
2
src/Verify.TUnit.Tests/Scrubbers/ScrubbersSample.RemoveOrReplace.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
linea | ||
linec |
Oops, something went wrong.