示例#1
0
        public async System.Threading.Tasks.Task DeleteEstate_NotSuccessAsync()
        {
            // Arrange
            var estateRepo         = new EstatesRepository(_context);
            var resultBeforeDelete = estateRepo.GetAllEstates();
            // Act
            await estateRepo.DeleteEstate(-1);

            var resultAfterDelete = estateRepo.GetAllEstates();

            // Assert
            CollectionAssert.AreEqual(resultBeforeDelete.Result, resultAfterDelete.Result);
        }
示例#2
0
        public void GetEstate_ById()
        {
            // Arrange
            var estateRepo     = new EstatesRepository(_context);
            var resultExpected = estateRepo.GetAllEstates();
            // Act
            var result = estateRepo.GetEstate(resultExpected.Result.First().Id);

            // Assert
            Assert.AreEqual(resultExpected.Result.First(), result.Result);
        }