Esempio n. 1
0
        public void PrimeDividersFalse()
        {
            // arrange
            int         number      = 20;
            IList <int> notExpected = new List <int>()
            {
                1, 2, 3, 4, 5
            };
            bool isEqual = false;

            // act
            var actual = NumericalUtility.EvenDividers(number);

            foreach (var item in notExpected)
            {
                if (!isEqual)
                {
                    break;
                }
                if (actual.IndexOf(item) == -1)
                {
                    isEqual = true;
                }
            }

            // assert
            Assert.IsFalse(isEqual);
        }
Esempio n. 2
0
        public void EvenDividersTrue()
        {
            // arrange
            int         number   = 20;
            IList <int> expected = new List <int>()
            {
                2, 4, 10, 20
            };
            bool isEqual = true;

            // act
            var actual = NumericalUtility.EvenDividers(number);

            foreach (var item in expected)
            {
                if (!isEqual)
                {
                    break;
                }
                if (actual.IndexOf(item) == -1)
                {
                    isEqual = false;
                }
            }

            // assert
            Assert.IsTrue(isEqual);
        }