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"))); }
public void TestCreateRouteInSummitGroup() { SummitGroup fakeGroup = new SummitGroup(); Mock <IRoutesDao> routeDaoMock = new Mock <IRoutesDao>(); routeDaoMock.Setup(x => x.CreateIn(It.IsAny <SummitGroup>(), It.IsAny <Route>())); IRouteService routeService = new RouteService(routeDaoMock.Object); routeService.CreateIn(fakeGroup, "Route"); routeDaoMock.Verify(x => x.CreateIn(fakeGroup, It.Is <Route>(y => y.Name == "Route"))); }
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"))); }