public async Task StatsService_GetDnaStatsAsync_40MutantsAnd100Humans_Succeeds() { //Arrange StatsService service = GetStatsService(); _memoryCacheServiceMock.Setup(x => x.GetAsync("mutantsCount", It.IsAny <Func <Task <int> > >())).ReturnsAsync(40).Verifiable(); _memoryCacheServiceMock.Setup(x => x.GetAsync("humansCount", It.IsAny <Func <Task <int> > >())).ReturnsAsync(100).Verifiable(); //Action DnaStats result = await service.GetDnaStatsAsync(); //Asserts Assert.IsNotNull(result); Assert.AreEqual(40, result.CountMutantDna); Assert.AreEqual(100, result.CountHumanDna); Assert.AreEqual(0.4m, result.Ratio); _memoryCacheServiceMock.Verify(x => x.GetAsync("mutantsCount", It.IsAny <Func <Task <int> > >()), Times.Once); _memoryCacheServiceMock.Verify(x => x.GetAsync("humansCount", It.IsAny <Func <Task <int> > >()), Times.Once); }