Exemplo n.º 1
0
        public void Number_VerifyNumberIsFactorial()
        {
            //Arrange
            var number = new Faker().Random.Int(0, 30);
            //Act
            var factorialNumber = new FactorialNumber(number);

            //Assert
            Assert.Equal(number, factorialNumber.Number);
        }
Exemplo n.º 2
0
        public void Number_FactorialNumber_VerificarExecaoComNumeroPositivos()
        {
            //Arrange
            var number    = new Faker().Random.Int(10001, 150000);
            var numberInt = new FactorialNumber(number);
            //Act
            var exception = Assert.Throws <Exception>(() => numberInt.FactorialNumberCalc(number));

            //Assert
            Assert.Equal("This value is out of the range", exception.Message);
        }
Exemplo n.º 3
0
        public void TestFactorialNumber6(int numb, int expectedResult)
        {
            int factorialNumb = FactorialNumber.GenerateFactorialNumber(number: numb);

            Assert.AreEqual(expectedResult, factorialNumb);
        }