public bool UpdateFlat(int flatId, double rent, double deposit, string description) { ctrFlatObj = new CtrFlat(); Console.WriteLine(); Console.WriteLine("UpdateFlat() " + GetExecutionThreadTime()); return(ctrFlatObj.UpdateFlat(flatId, rent, deposit, description)); }
public DataSet SearchFlats(string city, int minPrice, int maxPrice, int minDeposit, int maxDeposit) { ctrFlatObj = new CtrFlat(); Console.WriteLine(); Console.WriteLine("SearchFlats() " + GetExecutionThreadTime()); return(ctrFlatObj.searchFlats(minPrice, maxPrice, city, minDeposit, maxDeposit)); }
public bool UpdateFlatStatus(int fId, string status, string dateOfOffer, string availableFrom) { ctrFlatObj = new CtrFlat(); Console.WriteLine(); Console.WriteLine("EditLandlordProfile() " + GetExecutionThreadTime()); return(ctrFlatObj.UpdateFlatStatus(fId, status, dateOfOffer, availableFrom)); }
public void UpdateFlatsAttributesWithNullValues() { CtrFlat ctrFlatObj = new CtrFlat(); MdlFlat mdlFlatObj = GenerateFlatObj(); mdlFlatObj.Id = GetFlatId(mdlFlatObj); mdlFlatObj.Rent = 0; mdlFlatObj.Deposit = 0; mdlFlatObj.Description = ""; bool actual = ctrFlatObj.UpdateFlat(mdlFlatObj.Id, mdlFlatObj.Rent, mdlFlatObj.Deposit, mdlFlatObj.Description); bool expected = true; Assert.AreEqual(expected, actual); }
//simulate Student pressing accept offer public void UpdateFlatsStatusAcceptOffer() { CtrFlat ctrFlatObj = new CtrFlat(); MdlFlat mdlFlatObj = GenerateFlatObj(); mdlFlatObj.Id = GetFlatId(mdlFlatObj); mdlFlatObj.Status = "Closed"; mdlFlatObj.DateOfOffer = "None"; mdlFlatObj.AvailableFrom = "Not available"; bool actual = ctrFlatObj.UpdateFlatStatus(mdlFlatObj.Id, mdlFlatObj.Status, mdlFlatObj.DateOfOffer, mdlFlatObj.AvailableFrom); bool expected = true; Assert.AreEqual(expected, actual); }
public void ConfirmTenants() { CtrConfirmed ctrConfirmedObj = new CtrConfirmed(); FlatTestes flatTestsObj = new FlatTestes(); CtrFlat ctrFlatObj = new CtrFlat(); MdlFlat mdlFlatObj = flatTestsObj.GenerateFlatObj(); mdlFlatObj.Id = flatTestsObj.GetFlatId(mdlFlatObj); mdlFlatObj.DateOfOffer = "None"; CtrLandlord ctrLandlordObj = new CtrLandlord(); string output = ctrLandlordObj.AddFlat(mdlFlatObj.LandlordEmail, mdlFlatObj.Type, mdlFlatObj.Address, mdlFlatObj.PostCode, mdlFlatObj.City, mdlFlatObj.Rent, mdlFlatObj.Deposit, mdlFlatObj.AvailableFrom, mdlFlatObj.Description).Trim(); bool expected = true; bool actual = ctrConfirmedObj.ConfirmTenants(mdlFlatObj.Id, "*****@*****.**"); Assert.AreEqual(expected, actual); }