コード例 #1
0
            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);
            }
コード例 #2
0
            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);
            }
コード例 #3
0
 /// <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);
コード例 #4
0
            public void ShouldThrowExceptionWhenPageSizeIsInvalid()
            {
                var exception = Assert.Throws <InvalidOperationException>(() => MagickGeometry.FromPageSize("invalid"));

                Assert.Equal("Invalid page size specified.", exception.Message);
            }
コード例 #5
0
 public void ShouldThrowExceptionWhenPageSizeIsEmpty()
 {
     Assert.Throws <ArgumentException>("pageSize", () => MagickGeometry.FromPageSize(string.Empty));
 }
コード例 #6
0
 public void ShouldThrowExceptionWhenPageSizeIsNull()
 {
     Assert.Throws <ArgumentNullException>("pageSize", () => MagickGeometry.FromPageSize(null));
 }