Esempio n. 1
0
        public static NoteController GetInitialisedNotesController(INoteService noteService)
        {
            var controller = new NoteController(noteService)
            {
                Request = new HttpRequestMessage {RequestUri = new Uri("http://localhost/api/")},
                Configuration = new HttpConfiguration()
            };

            controller.Configuration.MapHttpAttributeRoutes();
            controller.Configuration.EnsureInitialized();

            return controller;
        }
 public void Setup()
 {
     _noteController = ControllerHelper.GetInitialisedNotesController(_mockNoteService.Object);
     AutoMapperConfig.Bootstrap();
 }
 public void NoteController_NullNoteService_ThrowsException()
 {
     //act
     var sut = new NoteController(null);
 }