Esempio n. 1
0
        void should_take_greatest_divisor()
        {
            //arrange
            var myPrimeFactorProvider = Substitute.For <IPrimeFactorsProvider>();

            myPrimeFactorProvider.Generate(99)
            .Returns(new List <int> {
                1, 2, 3, 5, 6, 7
            });

            //act
            var snum = new SimpleNum(myPrimeFactorProvider);


            var result = snum.GetGreatestDivisor(99);

            //assert
            result.Should().Be(7);
        }
Esempio n. 2
0
        void should_take_greatest_divisor()
        {
            //arrange
            var myPrimeFactorProvider = Substitute.For<IPrimeFactorsProvider>();

            myPrimeFactorProvider.Generate(99)
                .Returns(new List<int> {1,2,3,5,6,7});

            //act
            var snum = new SimpleNum(myPrimeFactorProvider);

            var result = snum.GetGreatestDivisor(99);
            //assert
            result.Should().Be(7);
        }