示例#1
0
        public void AccountWithPositiveHistory_CalculateRanking_RankingIsPositive_ConstructorInjection()
        {
            var fakeAccount    = new AlwaysPositiveHistoryFakeAccount();
            var accountRanking = new AccountRanking(fakeAccount);

            var actualRanking = accountRanking.CalculateRanking();

            Assert.That(actualRanking, Is.GreaterThan(0));
        }
示例#2
0
        public void AccountWithPositiveHistory_CalculateRanking_RankingIsPositive_Moq()
        {
            var fakeAccount = new Mock <IAccount>();

            fakeAccount.Setup(x => x.ImportAccountHistory()).Returns("[0, 100, 500, 300, 800, 500, 700, 1000]");

            var accountRanking = new AccountRanking {
                Account = fakeAccount.Object
            };

            var actualRanking = accountRanking.CalculateRanking();

            Assert.That(actualRanking, Is.GreaterThan(0));
        }