示例#1
0
        public void RoundedToFactor_ShouldReturnValidResult_ForUInt64_UsingLowFactor_InOutwardOnlyMode()
        {
            // Arrange.
            UInt64 target = 10;
            UInt64 factor = 3;
            var    mode   = FactorRoundingMode.OutwardOnly;

            // Act.
            var result = target.RoundedToFactor(factor, mode);

            // Assert.
            result.Should().Be(12);
        }
示例#2
0
        public void RoundedToFactor_ShouldReturnValidResult_ForUInt64_UsingHighFactor_InInwardOrOutwardMode()
        {
            // Arrange.
            UInt64 target = 10;
            UInt64 factor = 6;
            var    mode   = FactorRoundingMode.InwardOrOutward;

            // Act.
            var result = target.RoundedToFactor(factor, mode);

            // Assert.
            result.Should().Be(12);
        }
示例#3
0
        public void RoundedToFactor_ShouldRaiseArgumentOutOfRangeException_ForUInt64_WithUnspecifiedModeArgument()
        {
            // Arrange.
            UInt64 target = 10;
            UInt64 factor = 5;
            var    mode   = FactorRoundingMode.Unspecified;

            // Act.
            var action = new Action(() =>
            {
                var result = target.RoundedToFactor(factor, mode);
            });

            // Assert.
            action.Should().Throw <ArgumentOutOfRangeException>();
        }