Exemplo n.º 1
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);
        }
        public IActionResult All()
        {
            var thoughts  = _thoughtService.GetAll();
            var viewModel = GetBackofficeRoomViewModel(thoughts);

            return(View(BackofficeRoomViewPath, viewModel));
        }
Exemplo n.º 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);
        }
Exemplo n.º 4
0
 private IEnumerable <ThoughtViewModel> GetFeed()
 {
     return(_thoughtService.GetAll().Map <IEnumerable <ThoughtViewModel> >());
 }