public async Task GetUserVisitsStatesForNonExistingUser() { var controller = new UserVisitsController(new TestLogger <GeographyController>(), VisitsRepositoryFactory.GetInstance(), GeographyRepositoryFactory.GetInstance()); var result = await controller.GetUserVisitsStates(_nonExistingUser); Assert.IsTrue(result.GetType().Equals(typeof(NotFoundResult))); }
public async Task GetUserVisitForExistingUserAndExistingVisit() { var controller = new UserVisitsController(new TestLogger <GeographyController>(), VisitsRepositoryFactory.GetInstance(), GeographyRepositoryFactory.GetInstance()); var result = await controller.GetUserVisit(_existingUser, _existingVisit); Assert.IsTrue(result.GetType().Equals(typeof(OkObjectResult))); }
public async Task PostUserVisitForExistingUserAndNotExistingCity() { var controller = new UserVisitsController(new TestLogger <GeographyController>(), VisitsRepositoryFactory.GetInstance(), GeographyRepositoryFactory.GetInstance()); var visitRepresentation = new PostVisitRepresentation() { City = _nonExistingCity, State = _existingState }; var result = await controller.PostUserVisit(_nonExistingUser, visitRepresentation); Assert.IsTrue(result.GetType().Equals(typeof(BadRequestResult))); }