コード例 #1
0
        public void Divide_DivideAreaAndAreaToLength_Throws()
        {
            var    numerator   = new Area(amount: 8.0);
            var    denominator = new Area(amount: 200.0, unit: Area.SquareDeciMeter);
            Length throws;

            Assert.That(() => ArithmeticOperations.Divide(numerator, denominator, out throws),
                        Throws.TypeOf <InvalidOperationException>());
        }
コード例 #2
0
        public void Divide_DivideVolumeAndLength_ReturnsArea()
        {
            var  expected    = new Area(amount: 4.0);
            var  numerator   = new Volume(amount: 8.0);
            var  denominator = new Length(amount: 200.0, unit: Length.CentiMeter);
            Area actual; ArithmeticOperations.Divide(numerator, denominator, out actual);

            MeasureAssert.MeasuresAreEqual(expected, actual);
        }