Пример #1
0
        public async Task AddAsync_AddsItemToDatabase()
        {
            var numberOfItemsInDatabase = await _context.Subjects.AsQueryable().CountAsync();

            await _service.CreateEntityAsync(new SubjectDto { Id = "testSubject1", Name = "Test Subject", LecturerId = "1" });

            _context.Subjects.AsQueryable().CountAsync().Result.Should().Be(numberOfItemsInDatabase + 1);
            _validator.VerifyAll();
        }