Esempio n. 1
0
        public void TestResultPointsWithDriverNames()
        {
            List <ElertPont> expectedPoints = new List <ElertPont>()
            {
                new ElertPont()
                {
                    DriverName = "Hamilton", Points = 50
                },
                new ElertPont()
                {
                    DriverName = "Bottas", Points = 35
                },
                new ElertPont()
                {
                    DriverName = "Leklerk", Points = 30
                },
                new ElertPont()
                {
                    DriverName = "Latifi", Points = 13
                }
            };
            var results = OsszetettLogic.TestGetDriversPoints(this.eredmenyRepo.Object, this.versenyzoRepo.Object).AsQueryable();

            Assert.That(results, Is.EquivalentTo(expectedPoints));
            this.eredmenyRepo.Verify(repo => repo.GetAll(), Times.Once);
            this.versenyzoRepo.Verify(repo => repo.GetAll(), Times.Once);
            this.versenyzoRepo.Verify(repo => repo.GetOne(It.IsAny <int>()), Times.Never);
        }
Esempio n. 2
0
        public void TestTeamWithMostPointsWithCurrentDrivers()
        {
            string teamWithMostPointsWithCurrentDrivers = OsszetettLogic.TestGetTeamWithMostPoints(this.versenyzoRepo.Object, this.csapatRepo.Object);
            string expectedTeam = "Ferrari";

            Assert.That(teamWithMostPointsWithCurrentDrivers, Is.EqualTo(expectedTeam));
            this.versenyzoRepo.Verify(repo => repo.GetAll(), Times.Once);
            this.csapatRepo.Verify(repo => repo.GetAll(), Times.Once);
        }
Esempio n. 3
0
        public void TestResultOfOneWeekendByEngine()
        {
            List <string> engineResult = new List <string>()
            {
                "Mercedes",
                "Ferrari",
                "Mercedes",
                "Mercedes"
            };
            var result = OsszetettLogic.TestGetResultWithEngineNames(1, this.eredmenyRepo.Object, this.csapatRepo.Object, this.versenyzoRepo.Object);

            Assert.That(result, Is.EquivalentTo(engineResult));
            this.eredmenyRepo.Verify(repo => repo.GetAll(), Times.Once);
            this.versenyzoRepo.Verify(repo => repo.GetAll(), Times.Once);
            this.versenyzoRepo.Verify(repo => repo.GetAll(), Times.Once);
        }