public void ShouldProduceValidResult()
            {
                // arrange
                var nominator   = CreateRadianAngle();
                var denominator = new RadianAngle(Fixture.CreateNonZeroNumber());

                // act
                number result = nominator / denominator;

                // assert
                result.Should().Be(nominator.Radians / denominator.Radians);
            }
            public void ShouldProduceValidResult()
            {
                // arrange
                var nominator   = CreateDegreeAngle();
                var denominator = new DegreeAngle(Fixture.CreateNonZeroNumber());

                // act
                number result = nominator / denominator;

                // assert
                result.Should().Be(nominator.TotalSeconds / denominator.TotalSeconds);
            }
Пример #3
0
            public void ShouldProduceValidDoubleResult()
            {
                // arrange
                var nominator   = CreateLengthInUnitOtherThan(LengthUnit.Metre);
                var denominator = new Length(
                    value: Fixture.CreateNonZeroNumber(),
                    unit: CreateUnitOtherThan(LengthUnit.Metre, nominator.Unit));

                // act
                number result = nominator / denominator;

                // assert
                result.Should().Be(nominator.Metres / denominator.Metres);
            }
            public void ShouldProduceValidResult()
            {
                // arrange
                var nominator   = CreatePowerInUnitOtherThan(PowerUnit.Watt);
                var denominator = new Power(
                    value: Fixture.CreateNonZeroNumber(),
                    unit: CreateUnitOtherThan(PowerUnit.Watt, nominator.Unit));

                // act
                number result = nominator / denominator;

                // assert
                result.Should().BeApproximately(nominator.Watts / denominator.Watts);
            }
            public void ShouldProduceValidResult()
            {
                // arrange
                var nominator   = CreateAngleInUnitOtherThan(AngleUnit.Turn);
                var denominator = new Angle(
                    value: Fixture.CreateNonZeroNumber(),
                    unit: CreateUnitOtherThan(AngleUnit.Turn, nominator.Unit));

                // act
                number result = nominator / denominator;

                // assert
                result.Should().BeApproximately(nominator.Turns / denominator.Turns);
            }
            public void DivideNullByVolume_ShouldTreatNullAsDefault()
            {
                // arrange
                Volume?nominator   = null;
                var    denominator = new Volume(
                    value: Fixture.CreateNonZeroNumber(),
                    unit: CreateUnitOtherThan(VolumeUnit.CubicMetre));

                // act
                number result = nominator / denominator;

                // assert
                result.Should().Be(default(Volume) / denominator);
            }
Пример #7
0
            public void ShouldProduceValidDoubleResult()
            {
                // arrange
                var nominator   = CreateSpecificEnergyInUnitOtherThan(SpecificEnergyUnit.JoulePerKilogram);
                var denominator = new SpecificEnergy(
                    value: Fixture.CreateNonZeroNumber(),
                    unit: CreateUnitOtherThan(SpecificEnergyUnit.JoulePerKilogram, nominator.Unit));

                // act
                number result = nominator / denominator;

                // assert
                result.Should().Be(nominator.JoulesPerKilogram / denominator.JoulesPerKilogram);
            }
Пример #8
0
            public void ShouldProduceValidResult()
            {
                // arrange
                var nominator   = CreateWeightInUnitOtherThan(WeightUnit.Kilogram);
                var denominator = new Weight(
                    value: Fixture.CreateNonZeroNumber(),
                    unit: CreateUnitOtherThan(WeightUnit.Kilogram, nominator.Unit));

                // act
                number result = nominator / denominator;

                // assert
                result.Should().BeApproximately(nominator.Kilograms / denominator.Kilograms, because: $"{nominator} divide by {denominator} shoud return {nominator.Kilograms / denominator.Kilograms} kg");
            }
Пример #9
0
            public void DivideNullByArea_ShouldTreatNullAsDefault()
            {
                // arrange
                Area?nominator   = null;
                var  denominator = new Area(
                    value: Fixture.CreateNonZeroNumber(),
                    unit: CreateUnitOtherThan(AreaUnit.SquareMetre));

                // act
                number result = nominator / denominator;

                // assert
                result.Should().Be(default(Area) / denominator);
            }
Пример #10
0
            public void ShouldProduceValidDoubleResult()
            {
                // arrange
                var nominator   = CreateSpeedInUnitOtherThan(SpeedUnit.MetrePerSecond);
                var denominator = new Speed(
                    value: Fixture.CreateNonZeroNumber(),
                    unit: CreateUnitOtherThan(SpeedUnit.MetrePerSecond, nominator.Unit));

                // act
                number result = nominator / denominator;

                // assert
                result.Should().Be(nominator.MetresPerSecond / denominator.MetresPerSecond);
            }
Пример #11
0
            public void ShouldProduceValidResult()
            {
                // arrange
                var nominator   = CreateEnergyInUnitOtherThan(EnergyUnit.Joule);
                var denominator = new Energy(
                    value: Fixture.CreateNonZeroNumber(),
                    unit: CreateUnitOtherThan(EnergyUnit.Joule, nominator.Unit));

                // act
                number result = nominator / denominator;

                // assert
                result.Should().BeApproximately(nominator.Joules / denominator.Joules);
            }