public static EmailController GetInitialisedEmailController(IEmailService emailService) { var controller = new EmailController(emailService) { Request = new HttpRequestMessage { RequestUri = new Uri("http://localhost/api/") }, Configuration = new HttpConfiguration() }; controller.Configuration.MapHttpAttributeRoutes(); controller.Configuration.EnsureInitialized(); return controller; }
public void EmailController_NulEmailService_ThrowsException() { //act var sut = new EmailController(null); }
public void Setup() { _emailController = ControllerHelper.GetInitialisedEmailController(_mockEmailService.Object); AutoMapperConfig.Bootstrap(); }