Beispiel #1
0
        public void Number_VerifyNumberIsPerfect_VerifyExceptionForValuesGreater10000()
        {
            // Arrange
            var number         = new Faker().Random.Int(10001, 3000);
            var _perfectNumber = new PerfectNumber(number);

            // Act
            var exception = Assert.Throws <Exception>(() => _perfectNumber.VerifyNumberIsPerfect(number));

            // Assert
            Assert.Equal("The number is out of limits!", exception.Message);
        }
Beispiel #2
0
        public void Number_VerifyNumberIsPerfect_VerifyExceptionNegativeNumbers()
        {
            // Arrange
            var number         = new Faker().Random.Int(-1000, 0);
            var _perfectNumber = new PerfectNumber(number);

            // Act
            var exception = Assert.Throws <Exception>(() => _perfectNumber.VerifyNumberIsPerfect(number));

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