Пример #1
0
        public async Task Find_WhenCalled_ShouldWork()
        {
            var expected = "1234567890";

            _mockAdapter.Setup(_ => _.FindAll()).Returns(Task.FromResult(
                                                             new SkillListDto {
                Skills = new List <SkillDto> {
                    new SkillDto {
                        Id = expected
                    }
                }
            }
                                                             ));
            var controller = new SkillsController(_mockRepository.Object, _mockAdapter.Object, _mockLogger.Object);
            var actual     = await controller.Find();

            Assert.IsAssignableFrom <ActionResult <SkillListDto> >(actual);
            Assert.Contains(expected, JsonConvert.SerializeObject(actual));
        }