コード例 #1
0
        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;
        }
コード例 #2
0
 public void EmailController_NulEmailService_ThrowsException()
 {
     //act
     var sut = new EmailController(null);
 }
コード例 #3
0
 public void Setup()
 {
     _emailController = ControllerHelper.GetInitialisedEmailController(_mockEmailService.Object);
     AutoMapperConfig.Bootstrap();
 }