Пример #1
0
        public async Task GetAll_JournalNotFound_ReturnsNotFound()
        {
            _service.Setup(s =>
                           s.GetAllByJournal(It.IsAny <long>()))
            .ReturnsAsync(() => null);

            _controller = new EntriesController(_logger, _service.Object);

            var result = await _controller.GetAll(1L);

            result.Should().BeOfType <NotFoundResult>();
        }
Пример #2
0
        public async Task GetAll_JournalFound_ReturnsOk()
        {
            _service.Setup(s =>
                           s.GetAllByJournal(It.IsAny <long>()))
            .ReturnsAsync(new List <EntryDto>());

            _controller = new EntriesController(_logger, _service.Object);

            var result = await _controller.GetAll(1L);

            result.Should().BeOfType <OkObjectResult>();
        }