Exemple #1
0
        public async Task ListAsync_WhenSectionsExists_ThenReturnArrayOfSections()
        {
            Section section1 = new Section {
                ID = Guid.NewGuid(), Name = "Section1"
            };
            Section section2 = new Section {
                ID = Guid.NewGuid(), Name = "Section2"
            };

            sectionRepository.Upsert(section1);
            sectionRepository.Upsert(section2);
            dbContext.SaveChanges();

            Section[] dbSections = await sectionRepository.ListAsync();

            AssertSectionEqual(section1, dbSections.First(section => section.ID == section1.ID));
            AssertSectionEqual(section1, dbSections.First(section => section.ID == section1.ID));
        }