예제 #1
0
        public void TestConvertNameIntoId()
        {
            var            restRepo   = new Mock <IRestaurantRepository>();
            var            reviewRepo = new Mock <IReviewerRepository>();
            List <int>     restList   = new List <int>();
            RestaurantInfo dummyRest  = new RestaurantInfo(34, "repoTest", "test city", "test street", "descrip", "testemail");

            restList.Add(dummyRest.restaurantId);
            restRepo.Setup(i => i.ConvertNameIntoId("repoTest")).Returns(new List <int> {
                34
            });
            var service  = new RestaurantService(restRepo.Object, reviewRepo.Object);
            var expected = restList;
            var actual   = service.ConvertNameIntoId("repoTest");

            Assert.AreEqual(expected, actual, "Nope");
        }