Пример #1
0
        public async Task RegionDeleteDeletes()
        {
            //Arrange
            Region regionTest = new Region()
            {
                RegionID = 100, RegionDescription = "Acasa"
            };
            await _regionsControllerTest.Create(regionTest);

            int expected = db.Regions.Count() - 1;

            //Act
            await _regionsControllerTest.DeleteConfirmed(regionTest.RegionID);

            int actual = db.Regions.Count();

            //Assert
            Assert.AreEqual(expected, actual);

            var region = db.Regions.Where(r => r.RegionDescription == regionTest.RegionDescription);

            db.Regions.RemoveRange(region);
            db.SaveChanges();
        }