Пример #1
0
        public void HouseHoldListingCreatePass()
        {
            //Arrange
            bool expected = true;
            //Act
            HouseHoldService hhs     = new HouseHoldService(hdao);
            HouseHold        request = new HouseHold(1000.00, "Testing address", 92868, false);

            int     newID  = hhs.CreateHouseHold(request);
            IResult result = hhs.CreateHouseHoldListing(newID);
            bool    actual = result.IsSuccess;

            Console.WriteLine(result.Message);
            hhs.DeleteHouseHoldListing(newID);
            hhs.DeleteHouseHold(newID);

            //Assert
            Assert.AreEqual(expected, actual);
        }
Пример #2
0
        //Delete HouseHoldListing first and then delete HouseHold
        public IResult DeleteHouseHold(int hID)
        {
            bool ifSuccess = houseHoldService.DeleteHouseHoldListing(hID);

            if (ifSuccess)
            {
                ifSuccess = houseHoldService.DeleteHouseHold(hID);

                if (ifSuccess)
                {
                    return(new CheckResult("Delete Successed!", true));
                }
                else
                {
                    return(new CheckResult("Delete Failed!", false));
                }
            }
            else
            {
                return(new CheckResult("Delete Failed! Cannot delete HouseHoldListing!", false));
            }
        }