Пример #1
0
        public async Task GetAll_ReturnValueEqualsExpected_Success()
        {
            var expected = GetTestData();
            var value    = expected.Select(x => _mapper.Map <Needs>(x));

            _needsRepositoryMock.Setup(x => x.GetAllAsync()).ReturnsAsync(value);

            var actual = await _service.GetAll();

            var expectedSer = JsonConvert.SerializeObject(expected);
            var actualSer   = JsonConvert.SerializeObject(actual);

            Assert.AreEqual(expectedSer, actualSer);
        }
Пример #2
0
 public async Task <IEnumerable <NeedsDto> > GetAll()
 {
     return(await _service.GetAll());
 }