diff --git a/tests/SixLabors.Core.Tests/Helpers/DebugGuardTests.cs b/tests/SixLabors.Core.Tests/Helpers/DebugGuardTests.cs index f3db76ef54..68416b47dc 100644 --- a/tests/SixLabors.Core.Tests/Helpers/DebugGuardTests.cs +++ b/tests/SixLabors.Core.Tests/Helpers/DebugGuardTests.cs @@ -99,7 +99,7 @@ namespace SixLabors.Helpers.Tests }); Assert.Equal("myParamName", exception.ParamName); - Assert.True(exception.Message.Contains($"Value must be greater than {min}.")); + Assert.Contains($"Value must be greater than {min}.", exception.Message); } [Theory] @@ -119,7 +119,7 @@ namespace SixLabors.Helpers.Tests }); Assert.Equal("myParamName", exception.ParamName); - Assert.True(exception.Message.Contains($"Value must be greater than or equal to 2.")); + Assert.Contains($"Value must be greater than or equal to 2.", exception.Message); } [Theory] diff --git a/tests/SixLabors.Core.Tests/Helpers/GuardTests.cs b/tests/SixLabors.Core.Tests/Helpers/GuardTests.cs index f95e46e355..ecffd79daa 100644 --- a/tests/SixLabors.Core.Tests/Helpers/GuardTests.cs +++ b/tests/SixLabors.Core.Tests/Helpers/GuardTests.cs @@ -65,7 +65,7 @@ namespace SixLabors.Helpers.Tests }); Assert.Equal("myParamName", exception.ParamName); - Assert.True(exception.Message.Contains($"Value must be greater than {min}.")); + Assert.Contains($"Value must be greater than {min}.", exception.Message); } [Theory] @@ -108,7 +108,7 @@ namespace SixLabors.Helpers.Tests }); Assert.Equal("myParamName", exception.ParamName); - Assert.True(exception.Message.Contains($"Value must be greater than or equal to {min} and less than or equal to {max}.")); + Assert.Contains($"Value must be greater than or equal to {min} and less than or equal to {max}.", exception.Message); } [Theory] @@ -128,7 +128,7 @@ namespace SixLabors.Helpers.Tests }); Assert.Equal("myParamName", exception.ParamName); - Assert.True(exception.Message.Contains($"The size must be at least 3.")); + Assert.Contains("The size must be at least 3.", exception.Message); } } }