コード例 #1
0
        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)));
        }
コード例 #2
0
        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)));
        }
コード例 #3
0
        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)));
        }