Skip to content

Commit

Permalink
fix IgnoreStackTrack typo (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored Jun 4, 2022
1 parent 7d8dd50 commit 929fc9f
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project>
<PropertyGroup>
<NoWarn>CS1591;CS0649;xUnit1026;xUnit1013;msb3277;CS0436</NoWarn>
<Version>17.1.0</Version>
<Version>17.1.1</Version>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>10</LangVersion>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
Expand Down
4 changes: 2 additions & 2 deletions src/Verify.ExceptionParsing.Tests/ExceptionParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ public Task Error_EmptyList() =>
{
Environment.NewLine
}))
.IgnoreStackTrack();
.IgnoreStackTrace();

[Fact]
public Task Error_EmptyDirectory() =>
Throws(() => Parser.Parse(new[]
{
"Directory: "
}))
.IgnoreStackTrack();
.IgnoreStackTrace();

[Fact]
public Task Empty()
Expand Down
8 changes: 4 additions & 4 deletions src/Verify.Tests/Serialization/SerializationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -739,21 +739,21 @@ public Task ThrowForDateFormatHandling() =>
ThrowsTask(
() => Verify("foo")
.AddExtraSettings(_ => _.DateFormatHandling = DateFormatHandling.MicrosoftDateFormat))
.IgnoreStackTrack();
.IgnoreStackTrace();

[Fact]
public Task ThrowForDateTimeZoneHandling() =>
ThrowsTask(
() => Verify("foo")
.AddExtraSettings(_ => _.DateTimeZoneHandling = DateTimeZoneHandling.Unspecified))
.IgnoreStackTrack();
.IgnoreStackTrace();

[Fact]
public Task ThrowForDateFormatString() =>
ThrowsTask(
() => Verify("foo")
.AddExtraSettings(_ => _.DateFormatString = "DateFormatHandling.MicrosoftDateFormat"))
.IgnoreStackTrack();
.IgnoreStackTrace();

Task DontScrubDateTimes()
{
Expand Down Expand Up @@ -1781,7 +1781,7 @@ public class IgnoreTargetSub :
[Fact]
public Task IgnoreMemberSubClass() =>
Throws(() => VerifierSettings.IgnoreMember<IgnoreTargetSub>(_ => _.Property))
.IgnoreStackTrack();
.IgnoreStackTrace();

[Fact]
public Task IgnoreJTokenByName()
Expand Down
4 changes: 2 additions & 2 deletions src/Verify.Tests/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -485,12 +485,12 @@ public Task ShouldThrowForExtensionOnSerialization()
var settings = new VerifySettings();
settings.UseExtension("json");
settings.UseMethodName("Foo");
settings.IgnoreStackTrack();
settings.IgnoreStackTrace();
settings.DisableDiff();

var element = new Element();
return Verifier.ThrowsTask(() => Verify(element, settings))
.IgnoreStackTrack();
.IgnoreStackTrace();
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static void IgnoreMembers(Type declaringType, params string[] names) =>
public static void IgnoreMember(Type declaringType, string name) =>
serialization.IgnoreMember(declaringType, name);

public static void IgnoreStackTrack() =>
public static void IgnoreStackTrace() =>
serialization.IgnoreMember("StackTrace");

public static void IgnoreMember(string name) =>
Expand Down
6 changes: 5 additions & 1 deletion src/Verify/Serialization/VerifySettings_SerializationMaps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ public void DontScrubDateTimes()
serialization.DontScrubDateTimes();
}

public void IgnoreStackTrack()
[Obsolete("Use IgnoreStackTrace", error:true)]
public void IgnoreStackTrack() =>
IgnoreStackTrace();

public void IgnoreStackTrace()
{
CloneSettings();
serialization.IgnoreMember("StackTrace");
Expand Down
8 changes: 6 additions & 2 deletions src/Verify/SettingsTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,13 @@ public SettingsTask ScrubLinesContaining(params string[] stringToMatch)
return this;
}

public SettingsTask IgnoreStackTrack()
[Obsolete("Use IgnoreStackTrace", error:true)]
public SettingsTask IgnoreStackTrack() =>
IgnoreStackTrace();

public SettingsTask IgnoreStackTrace()
{
CurrentSettings.IgnoreStackTrack();
CurrentSettings.IgnoreStackTrace();
return this;
}

Expand Down

0 comments on commit 929fc9f

Please sign in to comment.