Exemple #1
0
        public async Task SaveRequestsToServiceTest()
        {
            const int number = 3;

            _uow.CommitAsync().Returns(number);

            int result = await _requestsService.SaveRequestsToDbAsync(RequestsGenerator.GetNRequestModels(number));

            Assert.Equal(number, result);
        }
        public void ModelsAreCorrectlyMappedToEntitiesTest()
        {
            List <RequestModel> models   = RequestsGenerator.GetNRequestModels(6).OrderBy(x => x.Name).ToList();
            List <Request>      requests = _mapper.ModelsToEntities(models).OrderBy(x => x.Name).ToList();

            for (int i = 0; i < 0; i++)
            {
                Assert.Equal(models[i].Name, requests[i].Name);
                Assert.Equal(models[i].Date, requests[i].Date);
                Assert.Equal(models[i].Visits, requests[i].Visits);
                Assert.Equal(models[i].Id, requests[i].Index);
            }
        }