Skip to content

Commit

Permalink
Fixing test dependencies, and removing timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
lookbusy1344 committed Mar 17, 2024
1 parent f49dc9b commit c466690
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 25 deletions.
6 changes: 3 additions & 3 deletions TestSearcher/MonotonicTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace TestSearcher;

public class MonotonicTest
{
[Fact(DisplayName = "Monotonic: Milliseconds from zero start", Timeout = 50)]
[Fact(DisplayName = "Monotonic: Milliseconds from zero start")]
[Trait("Category", "Monotonic")]
public void MonotonicZeroStart()
{
Expand All @@ -15,7 +15,7 @@ public void MonotonicZeroStart()
Assert.True(dur is >= 0 and <= 3);
}

[Fact(DisplayName = "Monotonic: should run at the same rate as wall clock", Timeout = 600)]
[Fact(DisplayName = "Monotonic: should run at the same rate as wall clock")]
[Trait("Category", "Monotonic")]
public void MonotonicTimeSpan()
{
Expand All @@ -32,7 +32,7 @@ public void MonotonicTimeSpan()
Assert.True(dur is >= 0 and <= 10);
}

[Theory(DisplayName = "Monotonic: Sleep Test with different durations", Timeout = 600)]
[Theory(DisplayName = "Monotonic: Sleep Test with different durations")]
[Trait("Category", "Monotonic")]
[InlineData(2)]
[InlineData(100)]
Expand Down
34 changes: 16 additions & 18 deletions TestSearcher/SearchTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ namespace TestSearcher;

public partial class SearchTests
{
private const int SearchTimeout = 2000;

[Fact(DisplayName = "Search: No matching items", Timeout = SearchTimeout)]
[Fact(DisplayName = "Search: No matching items")]
[Trait("Category", "Search")]
public void SearchNoMatch()
{
Expand All @@ -18,7 +16,7 @@ public void SearchNoMatch()
Assert.Empty(found);
}

[Fact(DisplayName = "GLOBS: Wrong glob - terrors of the earth", Timeout = SearchTimeout)]
[Fact(DisplayName = "GLOBS: Wrong glob - terrors of the earth")]
[Trait("Category", "Globs")]
public void SearchNoMatchingGlob()
{
Expand All @@ -35,7 +33,7 @@ public void SearchNoMatchingGlob()
Assert.Empty(found);
}

[Fact(DisplayName = "Search: Basic search TXT, PDF, ZIP - Terrors of the Earth", Timeout = SearchTimeout)]
[Fact(DisplayName = "Search: Basic search TXT, PDF, ZIP - Terrors of the Earth")]
[Trait("Category", "Search")]
public void TerrorsOfTheEarth()
{
Expand All @@ -49,7 +47,7 @@ public void TerrorsOfTheEarth()
Assert.True(Helpers.CompareNames(expected, found));
}

[Fact(DisplayName = "Search: Basic + ZIP - It is the east", Timeout = SearchTimeout)]
[Fact(DisplayName = "Search: Basic + ZIP - It is the east")]
[Trait("Category", "Search")]
public void ItIsTheEast()
{
Expand All @@ -63,7 +61,7 @@ public void ItIsTheEast()
Assert.True(Helpers.CompareNames(expected, found));
}

[Fact(DisplayName = "Search: Basic + ZIP - Poor player That struts", Timeout = SearchTimeout)]
[Fact(DisplayName = "Search: Basic + ZIP - Poor player That struts")]
[Trait("Category", "Search")]
public void PoorPlayerThatStruts()
{
Expand All @@ -77,7 +75,7 @@ public void PoorPlayerThatStruts()
Assert.True(Helpers.CompareNames(expected, found));
}

[Fact(DisplayName = "Search: TXT in ZIP in ZIP - Brown fox", Timeout = SearchTimeout)]
[Fact(DisplayName = "Search: TXT in ZIP in ZIP - Brown fox")]
[Trait("Category", "Search")]
public void BrownFoxNestedZip()
{
Expand All @@ -91,7 +89,7 @@ public void BrownFoxNestedZip()
Assert.True(Helpers.CompareNames(expected, found));
}

[Fact(DisplayName = "Search: Single TXT file - This day", Timeout = SearchTimeout)]
[Fact(DisplayName = "Search: Single TXT file - This day")]
[Trait("Category", "Search")]
public void ThisDayHenryV()
{
Expand All @@ -105,7 +103,7 @@ public void ThisDayHenryV()
Assert.True(Helpers.CompareNames(expected, found));
}

[Fact(DisplayName = "GLOBS: Explicit globs - terrors of the earth", Timeout = SearchTimeout)]
[Fact(DisplayName = "GLOBS: Explicit globs - terrors of the earth")]
[Trait("Category", "Globs")]
public void TerrorsOfTheEarthGlobs()
{
Expand All @@ -123,7 +121,7 @@ public void TerrorsOfTheEarthGlobs()
Assert.True(Helpers.CompareNames(expected, found));
}

[Fact(DisplayName = "ZIP: Single glob and zip", Timeout = SearchTimeout)]
[Fact(DisplayName = "ZIP: Single glob and zip")]
[Trait("Category", "Zip")]
public void SingleGlobNoZip()
{
Expand All @@ -142,7 +140,7 @@ public void SingleGlobNoZip()
Assert.True(Helpers.CompareNames(expected, found));
}

[Fact(DisplayName = "ZIP: Two globs including zip match", Timeout = SearchTimeout)]
[Fact(DisplayName = "ZIP: Two globs including zip match")]
[Trait("Category", "Zip")]
public void GlobsAndZip()
{
Expand All @@ -161,7 +159,7 @@ public void GlobsAndZip()
Assert.True(Helpers.CompareNames(expected, found));
}

[Fact(DisplayName = "CASE: Wrong case, but case-insensitive", Timeout = SearchTimeout)]
[Fact(DisplayName = "CASE: Wrong case, but case-insensitive")]
[Trait("Category", "Case")]
public void CaseInsensitiveBasic()
{
Expand All @@ -180,7 +178,7 @@ public void CaseInsensitiveBasic()
Assert.True(Helpers.CompareNames(expected, found));
}

[Fact(DisplayName = "CASE: Wrong case, case-sensitive", Timeout = SearchTimeout)]
[Fact(DisplayName = "CASE: Wrong case, case-sensitive")]
[Trait("Category", "Case")]
public void CaseSensitive()
{
Expand All @@ -199,7 +197,7 @@ public void CaseSensitive()
Assert.Empty(found);
}

[Fact(DisplayName = "CASE: Correct case, case-sensitive", Timeout = SearchTimeout)]
[Fact(DisplayName = "CASE: Correct case, case-sensitive")]
[Trait("Category", "Case")]
public void CaseSensitiveMatch()
{
Expand All @@ -218,7 +216,7 @@ public void CaseSensitiveMatch()
Assert.True(Helpers.CompareNames(expected, found));
}

[Fact(DisplayName = "CLI: Command line parsing basic", Timeout = SearchTimeout)]
[Fact(DisplayName = "CLI: Command line parsing basic")]
[Trait("Category", "CLI")]
public void BasicCommandLineParse()
{
Expand All @@ -232,7 +230,7 @@ public void BasicCommandLineParse()
Assert.True(Helpers.CompareNames(expected, found));
}

[Fact(DisplayName = "CLI: Command line parsing complex", Timeout = SearchTimeout)]
[Fact(DisplayName = "CLI: Command line parsing complex")]
[Trait("Category", "CLI")]
public void ComplexCommandLineParse()
{
Expand All @@ -246,7 +244,7 @@ public void ComplexCommandLineParse()
Assert.True(Helpers.CompareNames(expected, found));
}

[Fact(DisplayName = "CLI: Command line parsing with error", Timeout = SearchTimeout)]
[Fact(DisplayName = "CLI: Command line parsing with error")]
[Trait("Category", "CLI")]
public void ErrorCommandLineParse()
{
Expand Down
8 changes: 4 additions & 4 deletions TestSearcher/TestSearcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="xunit" Version="2.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down

0 comments on commit c466690

Please sign in to comment.