Пример #1
0
        public async Task Dd_Get5BestScore_ListRestaurantBefore_ReturnList5BestScoredRestaurant()
        {
            //Arrange
            var restaurantService = new RestaurantService();

            restaurantsToDelete.Add(new Restaurant()
            {
                Grade = new Grade()
                {
                    Score = 1
                }
            });
            restaurantService.Create(restaurantsToDelete.Last());
            restaurantsToDelete.Add(new Restaurant()
            {
                Grade = new Grade()
                {
                    Score = 3
                }
            });
            restaurantService.Create(restaurantsToDelete.Last());
            restaurantsToDelete.Add(new Restaurant()
            {
                Grade = new Grade()
                {
                    Score = 5
                }
            });
            restaurantService.Create(restaurantsToDelete.Last());
            restaurantsToDelete.Add(new Restaurant()
            {
                Grade = new Grade()
                {
                    Score = 8
                }
            });
            restaurantService.Create(restaurantsToDelete.Last());
            restaurantsToDelete.Add(new Restaurant()
            {
                Grade = new Grade()
                {
                    Score = 9
                }
            });
            restaurantService.Create(restaurantsToDelete.Last());
            var restosBefore = restaurantService.GetAll();

            //Act
            var result = restaurantService.Get5BestScore();

            //Assert
            //Assert.AreEqual(9, result.First().Grade.Score);
            Assert.AreNotEqual(restosBefore.First(), result.First());

            //Clean up database
            await deleteTestResto();
        }