예제 #1
0
        public async Task ShouldGetEntryById()
        {
            var entry         = Mother.GenericEntry;
            var entryResponse = Mother.GenericEntryResponse;
            var entryId       = Mother.TestEntryId;

            _mapper
            .Setup(m => m.Map <EntryResponse>(entry))
            .Returns(entryResponse);
            _entryAccess
            .Setup(ea => ea.GetByIdAsync(entryId))
            .ReturnsAsync(entry);

            var actual = await _sut.GetOne(entryId);

            var result = (OkObjectResult)actual;

            Assert.AreEqual(entryResponse, result.Value);
        }