Ejemplo n.º 1
0
            public void ShouldNotConvertUndefinedToPixelsPerInch()
            {
                var density = new Density(1, 2, DensityUnit.Undefined);

                var newDensity = density.ChangeUnits(DensityUnit.PixelsPerInch);

                Assert.Equal(1, newDensity.X);
                Assert.Equal(2, newDensity.Y);
                Assert.Equal(DensityUnit.PixelsPerInch, newDensity.Units);
            }
Ejemplo n.º 2
0
            public void ShouldConvertPixelsPerInchToPixelsPerCentimeter()
            {
                var density = new Density(2.54, 5.08, DensityUnit.PixelsPerInch);

                var newDensity = density.ChangeUnits(DensityUnit.PixelsPerCentimeter);

                Assert.Equal(1, newDensity.X);
                Assert.Equal(2, newDensity.Y);
                Assert.Equal(DensityUnit.PixelsPerCentimeter, newDensity.Units);
            }
Ejemplo n.º 3
0
            public void ShouldConvertPixelsPerCentimeterToPixelsPerInch()
            {
                var density = new Density(1, 2, DensityUnit.PixelsPerCentimeter);

                var newDensity = density.ChangeUnits(DensityUnit.PixelsPerInch);

                Assert.AreEqual(2.54, newDensity.X);
                Assert.AreEqual(5.08, newDensity.Y);
                Assert.AreEqual(DensityUnit.PixelsPerInch, newDensity.Units);
            }
Ejemplo n.º 4
0
            public void ShouldNotConvertPixelsPerCentimeterToUndefined()
            {
                var density = new Density(1, 2, DensityUnit.PixelsPerCentimeter);

                var newDensity = density.ChangeUnits(DensityUnit.Undefined);

                Assert.Equal(1, newDensity.X);
                Assert.Equal(2, newDensity.Y);
                Assert.Equal(DensityUnit.Undefined, newDensity.Units);
            }
Ejemplo n.º 5
0
            public void ShouldNotConvertUndefinedToUndefined()
            {
                var density = new Density(1, 2, DensityUnit.Undefined);

                var newDensity = density.ChangeUnits(DensityUnit.Undefined);

                Assert.AreEqual(1, newDensity.X);
                Assert.AreEqual(2, newDensity.Y);
                Assert.AreEqual(DensityUnit.Undefined, newDensity.Units);
            }