public void UserDetailShoudThrowHttpExceptionWhenUserDoesNotExist() { var autoMapperConfig = new AutoMapperConfig(typeof(GiftController).Assembly); autoMapperConfig.Execute(); var userServerce = new Mock<IUsersService>(); userServerce.Setup(x => x.GetById(It.IsAny<string>())) .Returns(new User()); var controller = new SettingsController(userServerce.Object); controller.WithCallTo(x => x.UpdateProfile(It.IsAny<string>())); }
public void UserDetailShoudWhenIdIsPassedCorrect() { var autoMapperConfig = new AutoMapperConfig(typeof(GiftController).Assembly); autoMapperConfig.Execute(); var userServerce = new Mock<IUsersService>(); userServerce.Setup(x => x.GetById("1")) .Returns(new User()); var controller = new SettingsController(userServerce.Object); controller.WithCallTo(x => x.UpdateProfile("1")) .ShouldRenderView("UpdateProfile"); }
public InstitutionControllerTests() { this.autoMapperConfig = new AutoMapperConfig(typeof(GiftController).Assembly); this.autoMapperConfig.Execute(); }