Beispiel #1
0
        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));
        }
Beispiel #2
0
        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));
        }
Beispiel #3
0
        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));
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        //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);
        }
Beispiel #6
0
        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);
        }