public void ShouldSetTheXAndYPosition() { var geometry = MagickGeometry.FromPageSize("a4+3+2"); Assert.Equal(595, geometry.Width); Assert.Equal(842, geometry.Height); Assert.Equal(3, geometry.X); Assert.Equal(2, geometry.Y); }
public void ShouldReturnTheCorrectGeometry() { var geometry = MagickGeometry.FromPageSize("a4"); Assert.Equal(595, geometry.Width); Assert.Equal(842, geometry.Height); Assert.Equal(0, geometry.X); Assert.Equal(0, geometry.Y); }
/// <summary> /// Initializes a new <see cref="IMagickGeometry"/> instance using the specified page size. /// </summary> /// <param name="pageSize">The page size.</param> /// <returns>A <see cref="IMagickGeometry"/> instance that represents the specified page size.</returns> public IMagickGeometry CreateFromPageSize(string pageSize) => MagickGeometry.FromPageSize(pageSize);
public void ShouldThrowExceptionWhenPageSizeIsInvalid() { var exception = Assert.Throws <InvalidOperationException>(() => MagickGeometry.FromPageSize("invalid")); Assert.Equal("Invalid page size specified.", exception.Message); }
public void ShouldThrowExceptionWhenPageSizeIsEmpty() { Assert.Throws <ArgumentException>("pageSize", () => MagickGeometry.FromPageSize(string.Empty)); }
public void ShouldThrowExceptionWhenPageSizeIsNull() { Assert.Throws <ArgumentNullException>("pageSize", () => MagickGeometry.FromPageSize(null)); }