public void TestCreateRouteInCountry() { Country fakeCountry = new Country(); Mock<IRoutesDao> routeDaoMock = new Mock<IRoutesDao>(); routeDaoMock.Setup(x => x.CreateIn(It.IsAny<Country>(), It.IsAny<Route>())); IRouteService routeService = new RouteService(routeDaoMock.Object); routeService.CreateIn(fakeCountry, "RouteInCountry"); routeDaoMock.Verify(x => x.CreateIn(fakeCountry, It.Is<Route>(y => y.Name == "RouteInCountry"))); }
public void TestCreateRouteInSummit() { Summit fakeSummit = new Summit(); Mock<IRoutesDao> routeDaoMock = new Mock<IRoutesDao>(); routeDaoMock.Setup(x => x.CreateIn(It.IsAny<Summit>(), It.IsAny<Route>())); IRouteService routeService = new RouteService(routeDaoMock.Object); routeService.CreateIn(fakeSummit, "Route"); routeDaoMock.Verify(x => x.CreateIn(fakeSummit, It.Is<Route>(y => y.Name == "Route"))); }
public void TestCreateRouteInArea() { Area fakeArea = new Area(); Mock<IRoutesDao> routeDaoMock = new Mock<IRoutesDao>(); routeDaoMock.Setup(x => x.CreateIn(It.IsAny<Area>(), It.IsAny<Route>())); IRouteService routeService = new RouteService(routeDaoMock.Object); routeService.CreateIn(fakeArea, "RouteInCountry"); routeDaoMock.Verify(x => x.CreateIn(fakeArea, It.Is<Route>(y => y.Name == "RouteInCountry"))); }