コード例 #1
0
        public void Number_VerifyNumberIsPerfect_VerifyExceptionForValuesGreater30()
        {
            // Arrange
            var number          = new Faker().Random.Int(31, 100);
            var _fatorialNumber = new FatorialNumber(number);

            // Act
            var exception = Assert.Throws <Exception>(() => _fatorialNumber.FatorialNumberCalculator(number));

            // Assert
            Assert.Equal("The number is out of limits!", exception.Message);
        }
コード例 #2
0
        public void Number_FatorialNumberCalculator_VerifyExceptionNegativeNumbers()
        {
            // Arrange
            var number          = new Faker().Random.Int(-1000, 0);
            var _fatorialNumber = new FatorialNumber(number);

            // Act
            var exception = Assert.Throws <Exception>(() => _fatorialNumber.FatorialNumberCalculator(number));

            // Assert
            Assert.Equal("The number is out of limits!", exception.Message);
        }