public void Write_OneRectangle() { var bitmap = TagsCloudBitmapWriter .Write(new List <Rectangle> { new Rectangle(0, 0, 100, 37) }); bitmap.Width.Should().Be(100); bitmap.Height.Should().Be(37); }
public void TearDown() { var context = TestContext.CurrentContext; if (context.Result.Status == TestStatus.Failed) { var fileName = $"{context.Test.Name}_{DateTime.Now:yy-MM-dd-HH-mm-ss}.bmp"; TagsCloudBitmapWriter.Write(layouter.Rectangles).Save(fileName, ImageFormat.Bmp); Assert.Fail($"Test's layout saved to {fileName}"); } }
public void HasNoEffectOnInitialCollection() { var rectangles = new List <Rectangle> { new Rectangle(-100, -50, 10, 20), new Rectangle(43, 70, 5, 6) }; TagsCloudBitmapWriter.Write(rectangles); rectangles.Should().Equal(rectangles); }
public void ShiftToPositiveCoordinates() { var bitmap = TagsCloudBitmapWriter .Write(new List <Rectangle> { new Rectangle(-100, -50, 10, 20), new Rectangle(43, 70, 5, 6) }); bitmap.Width.Should().Be(148); bitmap.Height.Should().Be(126); }
public void ThrowException_NoRectangles() { Action writeAction = () => TagsCloudBitmapWriter.Write(new List <Rectangle>()); writeAction.ShouldThrow <ArgumentException>(); }