feat: Replace Moq and FluentAssertions with NSubstitute and Shouldly in test projects
This commit is contained in:
parent
3c722a66df
commit
41d9dacfac
6 changed files with 96 additions and 91 deletions
|
|
@ -3,6 +3,7 @@ using System.Threading.Tasks;
|
|||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using SixLabors.ImageSharp.PixelFormats;
|
||||
using MaddoShared.ImageSharpTests.Helpers;
|
||||
using Shouldly;
|
||||
|
||||
namespace MaddoShared.ImageSharpTests.Tests
|
||||
{
|
||||
|
|
@ -36,8 +37,8 @@ namespace MaddoShared.ImageSharpTests.Tests
|
|||
var outPath = Path.Combine(ws.DestDir.FullName, state.NomeFileBig);
|
||||
using var outImg = SixLabors.ImageSharp.Image.Load<Rgba32>(outPath);
|
||||
|
||||
Assert.AreEqual(800, outImg.Width);
|
||||
Assert.AreEqual(600, outImg.Height);
|
||||
outImg.Width.ShouldBe(800);
|
||||
outImg.Height.ShouldBe(600);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System.Threading.Tasks;
|
|||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using SixLabors.ImageSharp.PixelFormats;
|
||||
using MaddoShared.ImageSharpTests.Helpers;
|
||||
using Shouldly;
|
||||
|
||||
namespace MaddoShared.ImageSharpTests.Tests
|
||||
{
|
||||
|
|
@ -43,8 +44,8 @@ namespace MaddoShared.ImageSharpTests.Tests
|
|||
// top band (upper 25%)
|
||||
var topCount = PixelInspector.CountNonBackgroundPixels(outPath, 0, 0, 800, (int)(600 * 0.25), new Rgba32(255, 255, 255, 255), tolerance: 10);
|
||||
|
||||
Assert.IsTrue(bottomCount > 50, $"Expected text pixels in bottom band, found {bottomCount}");
|
||||
Assert.IsTrue(bottomCount > topCount, "Expected more non-background pixels at bottom than top");
|
||||
(bottomCount > 50).ShouldBeTrue($"Expected text pixels in bottom band, found {bottomCount}");
|
||||
(bottomCount > topCount).ShouldBeTrue("Expected more non-background pixels at bottom than top");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue