diff --git a/src/ImageProcessor.UnitTests/Configuration/ImageProcessorBootrapperTests.cs b/src/ImageProcessor.UnitTests/Configuration/ImageProcessorBootrapperTests.cs index 1e394e865..77f498d50 100644 --- a/src/ImageProcessor.UnitTests/Configuration/ImageProcessorBootrapperTests.cs +++ b/src/ImageProcessor.UnitTests/Configuration/ImageProcessorBootrapperTests.cs @@ -21,7 +21,7 @@ namespace ImageProcessor.UnitTests.Configuration public class ImageProcessorBootrapperTests { [Test] - public void Singleton_is_instantiated() + public void BoostrapperSingletonIsInstantiated() { ImageProcessorBootstrapper.Instance.SupportedImageFormats.Count().Should().BeGreaterThan(0, "because there should be supported image formats"); diff --git a/src/ImageProcessor.UnitTests/Extensions/DoubleExtensionsUnitTests.cs b/src/ImageProcessor.UnitTests/Extensions/DoubleExtensionsUnitTests.cs index e3942c8e9..f4a7d2f88 100644 --- a/src/ImageProcessor.UnitTests/Extensions/DoubleExtensionsUnitTests.cs +++ b/src/ImageProcessor.UnitTests/Extensions/DoubleExtensionsUnitTests.cs @@ -29,7 +29,7 @@ namespace ImageProcessor.UnitTests.Extensions [TestCase(1.5, 2)] [TestCase(25.7, 26)] [TestCase(1289047, 255)] - public void TestDoubleToByte(double input, byte expected) + public void DoubleIsConvertedToByte(double input, byte expected) { byte result = input.ToByte(); Assert.AreEqual(expected, result); diff --git a/src/ImageProcessor.UnitTests/Extensions/IntegerExtensionsUnitTests.cs b/src/ImageProcessor.UnitTests/Extensions/IntegerExtensionsUnitTests.cs index 2adbe3b17..d8f74f3cb 100644 --- a/src/ImageProcessor.UnitTests/Extensions/IntegerExtensionsUnitTests.cs +++ b/src/ImageProcessor.UnitTests/Extensions/IntegerExtensionsUnitTests.cs @@ -28,7 +28,7 @@ namespace ImageProcessor.UnitTests.Extensions [TestCase(21, 0x15)] [TestCase(190, 0xBE)] [TestCase(3156, 0xFF)] - public void ToByteTest(int input, byte expected) + public void IntegerIsConvertedToByte(int input, byte expected) { byte result = input.ToByte(); Assert.AreEqual(expected, result); diff --git a/src/ImageProcessor.UnitTests/ImageFactoryUnitTests.cs b/src/ImageProcessor.UnitTests/ImageFactoryUnitTests.cs index ebc099a05..c2a5e4e41 100644 --- a/src/ImageProcessor.UnitTests/ImageFactoryUnitTests.cs +++ b/src/ImageProcessor.UnitTests/ImageFactoryUnitTests.cs @@ -40,7 +40,7 @@ namespace ImageProcessor.UnitTests /// Tests the loading of image from a file /// [Test] - public void TestLoadImageFromFile() + public void ImageIsLoadedFromFile() { foreach (FileInfo file in this.ListInputFiles()) { @@ -58,7 +58,7 @@ namespace ImageProcessor.UnitTests /// Tests the loading of image from a memory stream /// [Test] - public void TestLoadImageFromMemory() + public void ImageIsLoadedFromMemoryStream() { foreach (FileInfo file in this.ListInputFiles()) { @@ -81,7 +81,7 @@ namespace ImageProcessor.UnitTests /// Tests that the save method actually saves a file /// [Test] - public void TestSaveToDisk() + public void ImageIsSavedToDisk() { foreach (FileInfo file in this.ListInputFiles()) { @@ -102,7 +102,7 @@ namespace ImageProcessor.UnitTests /// Tests that the save method actually writes to memory /// [Test] - public void TestSaveToMemory() + public void ImageIsSavedToMemory() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -120,7 +120,7 @@ namespace ImageProcessor.UnitTests /// Tests that a filter is really applied by checking that the image is modified /// [Test] - public void TestApplyEffectAlpha() + public void AlphaIsModified() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -134,7 +134,7 @@ namespace ImageProcessor.UnitTests /// Tests that brightness changes is really applied by checking that the image is modified /// [Test] - public void TestApplyEffectBrightness() + public void BrightnessIsModified() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -148,7 +148,7 @@ namespace ImageProcessor.UnitTests /// Tests that background color changes are really applied by checking that the image is modified /// [Test] - public void TestApplyEffectBackgroundColor() + public void BackgroundColorIsChanged() { ImageFactory imageFactory = new ImageFactory(); imageFactory.Load(@"Images\text.png"); @@ -161,7 +161,7 @@ namespace ImageProcessor.UnitTests /// Tests that a contrast change is really applied by checking that the image is modified /// [Test] - public void TestApplyEffectContrast() + public void ContrastIsModified() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -175,7 +175,7 @@ namespace ImageProcessor.UnitTests /// Tests that a saturation change is really applied by checking that the image is modified /// [Test] - public void TestApplyEffectSaturation() + public void SaturationIsModified() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -189,7 +189,7 @@ namespace ImageProcessor.UnitTests /// Tests that a tint change is really applied by checking that the image is modified /// [Test] - public void TestApplyEffectTint() + public void TintIsModified() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -203,7 +203,7 @@ namespace ImageProcessor.UnitTests /// Tests that a vignette change is really applied by checking that the image is modified /// [Test] - public void TestApplyEffectVignette() + public void VignetteEffectIsApplied() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -217,7 +217,7 @@ namespace ImageProcessor.UnitTests /// Tests that a filter is really applied by checking that the image is modified /// [Test] - public void TestApplyEffectWatermark() + public void WatermarkIsApplied() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -237,7 +237,7 @@ namespace ImageProcessor.UnitTests /// Tests that a filter is really applied by checking that the image is modified /// [Test] - public void TestApplyEffectBlur() + public void BlurEffectIsApplied() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -251,7 +251,7 @@ namespace ImageProcessor.UnitTests /// Tests that a filter is really applied by checking that the image is modified /// [Test] - public void TestApplyEffectBlurWithLayer() + public void BlurWithLayerIsApplied() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -265,7 +265,7 @@ namespace ImageProcessor.UnitTests /// Tests that a filter is really applied by checking that the image is modified /// [Test] - public void TestApplyEffectSharpen() + public void SharpenEffectIsApplied() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -279,7 +279,7 @@ namespace ImageProcessor.UnitTests /// Tests that a filter is really applied by checking that the image is modified /// [Test] - public void TestApplyEffectSharpenWithLayer() + public void SharpenWithLayerIsApplied() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -293,7 +293,7 @@ namespace ImageProcessor.UnitTests /// Tests that all filters can be applied /// [Test] - public void TestApplyEffectFilter() + public void FilterIsApplied() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -327,7 +327,7 @@ namespace ImageProcessor.UnitTests /// Tests that a filter is really applied by checking that the image is modified /// [Test] - public void TestRoundedCorners() + public void RoundedCornersAreApplied() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -341,7 +341,7 @@ namespace ImageProcessor.UnitTests /// Tests that the image is well resized using constraints /// [Test] - public void TestResizeConstraints() + public void ImageIsResizedWithinConstraints() { const int MaxSize = 200; foreach (ImageFactory imageFactory in this.ListInputImages()) @@ -356,7 +356,7 @@ namespace ImageProcessor.UnitTests /// Tests that the image is well cropped /// [Test] - public void TestCrop() + public void ImageIsCropped() { const int MaxSize = 20; foreach (ImageFactory imageFactory in this.ListInputImages()) @@ -374,7 +374,7 @@ namespace ImageProcessor.UnitTests /// Tests that the image is well cropped /// [Test] - public void TestCropWithCropLayer() + public void ImageIsCroppedWithLayer() { const int MaxSize = 20; foreach (ImageFactory imageFactory in this.ListInputImages()) @@ -392,7 +392,7 @@ namespace ImageProcessor.UnitTests /// Tests that the image is flipped /// [Test] - public void TestFlip() + public void ImageIsFlipped() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -415,7 +415,7 @@ namespace ImageProcessor.UnitTests /// Tests that the image is resized /// [Test] - public void TestResize() + public void ImageIsResized() { const int NewSize = 150; foreach (ImageFactory imageFactory in this.ListInputImages()) @@ -431,7 +431,7 @@ namespace ImageProcessor.UnitTests /// Tests that the image is resized /// [Test] - public void TestResizeWithLayer() + public void ImageIsResizedWithLayer() { const int NewSize = 150; foreach (ImageFactory imageFactory in this.ListInputImages()) @@ -447,7 +447,7 @@ namespace ImageProcessor.UnitTests /// Tests that the image is resized /// [Test] - public void TestRotate() + public void ImageIsRotated() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -463,7 +463,7 @@ namespace ImageProcessor.UnitTests /// Tests that the images hue has been altered. /// [Test] - public void TestHue() + public void HueIsModified() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -483,7 +483,7 @@ namespace ImageProcessor.UnitTests /// Tests that the image has been pixelated. /// [Test] - public void TestPixelate() + public void PixelateEffectIsApplied() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -497,7 +497,7 @@ namespace ImageProcessor.UnitTests /// Tests that the images quality has been set. /// [Test] - public void TestQuality() + public void ImageQualityIsModified() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -513,7 +513,7 @@ namespace ImageProcessor.UnitTests /// Tests that the image has had a color replaced. /// [Test] - public void TestReplaceColor() + public void ColorIsReplaced() { foreach (ImageFactory imageFactory in this.ListInputImages()) { @@ -527,7 +527,7 @@ namespace ImageProcessor.UnitTests /// Tests that the various edge detection algorithms are applied. /// [Test] - public void TestEdgeDetection() + public void EdgeDetectionEffectIsApplied() { foreach (ImageFactory imageFactory in this.ListInputImages()) { diff --git a/src/ImageProcessor.UnitTests/Imaging/ColorUnitTests.cs b/src/ImageProcessor.UnitTests/Imaging/ColorUnitTests.cs index db88ca4f3..5f7756172 100644 --- a/src/ImageProcessor.UnitTests/Imaging/ColorUnitTests.cs +++ b/src/ImageProcessor.UnitTests/Imaging/ColorUnitTests.cs @@ -14,6 +14,7 @@ namespace ImageProcessor.UnitTests.Imaging using System.Drawing; using ImageProcessor.Imaging.Colors; using NUnit.Framework; + using FluentAssertions; /// /// Test harness for the color classes. @@ -25,36 +26,36 @@ namespace ImageProcessor.UnitTests.Imaging /// Tests the struct equality operators. /// [Test] - public void TestRgbaEquality() + public void RgbaColorImplementsEquals() { RgbaColor first = RgbaColor.FromColor(Color.White); RgbaColor second = RgbaColor.FromColor(Color.White); - Assert.AreEqual(first, second); + first.Equals(second).Should().BeTrue("because the color structure should implement Equals()"); } /// /// Tests the struct equality operators. /// [Test] - public void TestHslaEquality() + public void HslaColorImplementsEquals() { HslaColor first = HslaColor.FromColor(Color.White); HslaColor second = HslaColor.FromColor(Color.White); - Assert.AreEqual(first, second); + first.Equals(second).Should().BeTrue("because the color structure should implement Equals()"); } /// /// Tests the struct equality operators. /// [Test] - public void TestYCbCrEquality() + public void YCbCrColorImplementsEquals() { YCbCrColor first = YCbCrColor.FromColor(Color.White); YCbCrColor second = YCbCrColor.FromColor(Color.White); - Assert.AreEqual(first, second); + first.Equals(second).Should().BeTrue("because the color structure should implement Equals()"); } /// @@ -78,12 +79,13 @@ namespace ImageProcessor.UnitTests.Imaging [TestCase("#FFFFBB")] [TestCase("#FF002B")] [TestCase("#00ABFF")] - public void TestHslaConversion(string expected) + public void HslaColorShouldConvertToAndFromString(string expected) { Color color = ColorTranslator.FromHtml(expected); HslaColor hslaColor = HslaColor.FromColor(color); string result = ColorTranslator.ToHtml(hslaColor); - Assert.AreEqual(expected, result); + + result.Should().Be(expected); } /// @@ -107,12 +109,13 @@ namespace ImageProcessor.UnitTests.Imaging [TestCase("#FFFFBB")] [TestCase("#FF002B")] [TestCase("#00ABFF")] - public void TestRgbaConversion(string expected) + public void RgbaColorShouldConvertToAndFromString(string expected) { Color color = ColorTranslator.FromHtml(expected); RgbaColor rgbaColor = RgbaColor.FromColor(color); string result = ColorTranslator.ToHtml(rgbaColor); - Assert.AreEqual(expected, result); + + result.Should().Be(expected); } /// @@ -136,12 +139,13 @@ namespace ImageProcessor.UnitTests.Imaging [TestCase("#FFFFBB")] [TestCase("#FF002B")] [TestCase("#00ABFF")] - public void TestYCbCrConversion(string expected) + public void YCbCrColorShouldConvertToAndFromString(string expected) { Color color = ColorTranslator.FromHtml(expected); YCbCrColor yCbCrColor = YCbCrColor.FromColor(color); string result = ColorTranslator.ToHtml(yCbCrColor); - Assert.AreEqual(expected, result); + + result.Should().Be(expected); } } }