예제 #1
0
 public HomeController(ILogger <HomeController> logger, AppDbContext context, IThoughtService thoughtService, IViewService viewService, IConfiguration configuration)
 {
     _logger         = logger;
     _context        = context;
     _thoughtService = thoughtService;
     _viewService    = viewService;
     _configuration  = configuration;
 }
예제 #2
0
        public void ThoughtService_CreateThought_GetContainsIt()
        {
            // arrange
            IThoughtService service = GetServiceInstance();
            ThoughtModel    thought = GetRandomThought();

            // act
            service.Create(thought);

            // assert
            Assert.Equal(service.Get(thought.Id).Id, thought.Id);
        }
예제 #3
0
        public void ThoughtService_SaveNewThought_GetAllContainsIt()
        {
            // arrange
            IThoughtService service = GetServiceInstance();
            ThoughtModel    thought = GetRandomThought();

            // act
            service.Save(thought);

            // assert
            Assert.Contains(service.GetAll(), t => t.Id == thought.Id);
        }
예제 #4
0
        public void ThoughtService_DeleteThought_GetAllDoesntContainsIt()
        {
            // arrange
            IThoughtService service = GetServiceInstance();
            ThoughtModel    thought = GetRandomThought();

            // act
            service.Create(thought);
            Assert.Contains(service.GetAll(), t => t.Id == thought.Id);
            service.Delete(thought.Id);

            // assert
            Assert.DoesNotContain(service.GetAll(), t => t.Id == thought.Id);
        }
예제 #5
0
        public void ThoughtService_UpdateThought_TitlesAreEquals()
        {
            // arrange
            string          dummyTitle = "I love bananas!";
            IThoughtService service    = GetServiceInstance();
            ThoughtModel    thought    = GetRandomThought();

            // act
            thought       = service.Create(thought);
            thought.Title = dummyTitle;
            thought       = service.Save(thought);

            // assert
            Assert.Equal(dummyTitle, thought.Title);
        }
예제 #6
0
 public ThoughtsController(IThoughtService thoughtService)
 {
     _thoughtService = thoughtService;
 }
예제 #7
0
 public HomeController(IThoughtService thoughtService)
 {
     this.thoughtService = thoughtService;
 }
 public ThoughtsBackofficeController(IThoughtService thoughtService)
 {
     _thoughtService = thoughtService;
 }