示例#1
0
        public void GetSum_WithValidNumber_ReturnGreaterThanMinSum()
        {
            //Arrange
            var input    = 3;
            var maxValue = 1000;
            var minSum   = (maxValue / 2) - 1;
            var util     = Mock.CreateLike <IUtil>(config => config.MaxValue == maxValue && config.MaxInputValue == maxValue - 1 && config.MinSum == minSum);
            var service  = new FactorServiceTestClassBuilder().WithUtil(util).Build();

            //Act
            var result = service.GetSum(input);

            //Assert
            result.Should().BeGreaterThan(util.MinSum, "because the sum should be greater than (Max Value / 2) - 1");
        }
示例#2
0
        public void GetSum_WithValidValueof3_Returns166833()
        {
            //Arrange
            var input    = 3;
            var expected = 166833;
            var maxValue = 1000;
            var minSum   = (maxValue / 2) - 1;
            var util     = Mock.CreateLike <IUtil>(config => config.MaxValue == maxValue && config.MaxInputValue == maxValue - 1 && config.MinSum == minSum);
            var service  = new FactorServiceTestClassBuilder().WithUtil(util).Build();

            //Act
            var result = service.GetSum(input);

            //Assert
            result.Should().Be(expected, "because the valid value of 3's sum sum to the default value of 1000 should be 166833");
        }