Browse Source

[SL.Core] Use Assert.Contains when checking for substrings

af/octree-no-pixelmap
Jason Nelson 8 years ago
parent
commit
538e1e015e
  1. 4
      tests/SixLabors.Core.Tests/Helpers/DebugGuardTests.cs
  2. 6
      tests/SixLabors.Core.Tests/Helpers/GuardTests.cs

4
tests/SixLabors.Core.Tests/Helpers/DebugGuardTests.cs

@ -99,7 +99,7 @@ namespace SixLabors.Helpers.Tests
}); });
Assert.Equal("myParamName", exception.ParamName); 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] [Theory]
@ -119,7 +119,7 @@ namespace SixLabors.Helpers.Tests
}); });
Assert.Equal("myParamName", exception.ParamName); 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] [Theory]

6
tests/SixLabors.Core.Tests/Helpers/GuardTests.cs

@ -65,7 +65,7 @@ namespace SixLabors.Helpers.Tests
}); });
Assert.Equal("myParamName", exception.ParamName); 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] [Theory]
@ -108,7 +108,7 @@ namespace SixLabors.Helpers.Tests
}); });
Assert.Equal("myParamName", exception.ParamName); 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] [Theory]
@ -128,7 +128,7 @@ namespace SixLabors.Helpers.Tests
}); });
Assert.Equal("myParamName", exception.ParamName); 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);
} }
} }
} }

Loading…
Cancel
Save