コード例 #1
0
        public void DivideOperator_DivideByItself_ReturnsUnityDoublet()
        {
            var expected = new MeasureTriplet <Number, Number, Number>(1.0, 1.0, 1.0);
            var actual   = _instance / _instance;

            IMeasureTripletAssert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void TimesOperator_MultiplyScalarRhs_AllMeasuresEquallyScaled()
        {
            var expected = new MeasureTriplet <Time, Power, ElectricPotential>(15.0, 0.36, 1.8);;
            var actual   = _instance * 3.0;

            IMeasureTripletAssert.AreEqual(expected, actual);
        }
コード例 #3
0
        public void DivideOperator_DivideBy2And3And4_ReturnsHalfTimeOneThirdPowerOneFourthPotential()
        {
            var expected = new MeasureTriplet <Time, Power, ElectricPotential>(2.5, 0.04, 0.15);
            var actual   = _instance / new MeasureTriplet <Number, Number, Number>(2.0, 3.0, 4.0);

            IMeasureTripletAssert.AreEqual(expected, actual);
        }
コード例 #4
0
        public void TimesOperator_MultiplyBy2And3And4_ReturnsDoubleTimeThreeTimesPowerFourTimesPotential()
        {
            var expected = new MeasureTriplet <Time, Power, ElectricPotential>(10.0, 0.36, 2.4);
            var actual   = _instance * new MeasureTriplet <Number, Number, Number>(2.0, 3.0, 4.0);

            IMeasureTripletAssert.AreEqual(expected, actual);
        }
コード例 #5
0
        public void MinusOperator_SubtractInstanceWithItself_ReturnsZero()
        {
            var expected = new MeasureTriplet <Time, Power, ElectricPotential>(0.0, 0.0, 0.0);
            var actual   = _instance - _instance;

            IMeasureTripletAssert.AreEqual(expected, actual);
        }
コード例 #6
0
        public void PlusOperator_AddInstanceWithItself_ReturnsDoubleInstance()
        {
            var expected = new MeasureTriplet <Time, Power, ElectricPotential>(10.0, 0.24, 1.2);
            var actual   = _instance + _instance;

            IMeasureTripletAssert.AreEqual(expected, actual);
        }
コード例 #7
0
        public void TimesOperator_MultiplyNumberRhs_AllMeasuresEquallyScaled()
        {
            var expected = new StandardMeasureTriplet <Time, Power, ElectricPotential>(15.0, 0.36, 1.8);;
            var actual   = new StandardMeasure <Number>(3.0) * _instance;

            IMeasureTripletAssert.AreEqual(expected, actual);
        }