Exemple #1
0
        public void GetNonExistingLandlordData()
        {
            CtrLandlord ctrLandlordObj = new CtrLandlord();
            MdlLandlord mdlLandlordObj = ctrLandlordObj.GetLandlordData("*****@*****.**");

            Assert.IsNull(mdlLandlordObj.ContactPerson);
        }
Exemple #2
0
        public string AddLandlord(MdlLandlord mdlLandlordObj)
        {
            ctrLandlordObj = new CtrLandlord();

            Console.WriteLine();
            Console.WriteLine("AddLandlord() " + GetExecutionThreadTime());

            return(ctrLandlordObj.AddLandlord(mdlLandlordObj));
        }
Exemple #3
0
        public DataSet GetFlatsLandlord(string landlordEmail)
        {
            ctrLandlordObj = new CtrLandlord();

            Console.WriteLine();
            Console.WriteLine("GetFlatsLandlord() " + GetExecutionThreadTime());

            return(ctrLandlordObj.GetFlatsLandlord(landlordEmail));
        }
Exemple #4
0
        public bool EditLandlordProfile(MdlLandlord mdlLandlordObj)
        {
            ctrLandlordObj = new CtrLandlord();

            Console.WriteLine();
            Console.WriteLine("EditLandlordProfile() " + GetExecutionThreadTime());

            return(ctrLandlordObj.UpdateProfile(mdlLandlordObj));
        }
Exemple #5
0
        public MdlLandlord GetLandlordData(string email)
        {
            ctrLandlordObj = new CtrLandlord();

            Console.WriteLine();
            Console.WriteLine("GetLandlordData() " + GetExecutionThreadTime());

            return(ctrLandlordObj.GetLandlordData(email));
        }
Exemple #6
0
        public void AddNewLandlord()
        {
            CtrLandlord ctrLandlordObj = new CtrLandlord();
            MdlLandlord mdlLandlordObj = GenerateLandlordObj();
            string      expected       = "Registration successful.";
            string      actual;

            actual = ctrLandlordObj.AddLandlord(mdlLandlordObj).Trim();
            Assert.AreEqual(expected, actual);
        }
Exemple #7
0
        public void AddFlat()
        {
            CtrLandlord ctrLandlordObj = new CtrLandlord();
            MdlFlat     mdlFlatObj     = GenerateFlatObj();
            string      expected       = "Successfully added.";
            string      actual;

            actual = ctrLandlordObj.AddFlat(mdlFlatObj.LandlordEmail, mdlFlatObj.Type, mdlFlatObj.Address,
                                            mdlFlatObj.PostCode, mdlFlatObj.City, mdlFlatObj.Rent, mdlFlatObj.Deposit, mdlFlatObj.AvailableFrom, mdlFlatObj.Description).Trim();
            Assert.AreEqual(expected, actual);
        }
Exemple #8
0
        public string AddFlat(string landLordEmail, string type, string address,
                              string postCode, string city, double rent, double
                              deposit, string availableFrom, string description)
        {
            ctrLandlordObj = new CtrLandlord();

            Console.WriteLine();
            Console.WriteLine("AddFlat() " + GetExecutionThreadTime());

            return(ctrLandlordObj.AddFlat(landLordEmail, type, address, postCode, city, rent, deposit, availableFrom, description));
        }
Exemple #9
0
        public void GetLandlordData()
        {
            string      expected = "contactPerson";
            string      actual;
            CtrLandlord ctrLandlordObj = new CtrLandlord();

            MdlLandlord mdlLandlordObj = ctrLandlordObj.GetLandlordData("*****@*****.**");

            actual = mdlLandlordObj.ContactPerson.Trim();

            Assert.AreEqual(expected, actual);
        }
Exemple #10
0
        public void AddExistingLandlord()
        {
            CtrLandlord ctrLandlordObj = new CtrLandlord();
            MdlLandlord mdlLandlordObj = GenerateLandlordObj();

            mdlLandlordObj.Email = "*****@*****.**";
            string expected = "Registration has failed due to the existing Email.";
            string actual;

            actual = ctrLandlordObj.AddLandlord(mdlLandlordObj).Trim();
            Assert.AreEqual(expected, actual);
        }
Exemple #11
0
        public void AddFlatStudentEmail()
        {
            CtrLandlord ctrLandlordObj = new CtrLandlord();
            MdlFlat     mdlFlatObj     = GenerateFlatObj();

            mdlFlatObj.LandlordEmail = "*****@*****.**";
            string expected = "Unable to add flat due to nonexisting landlord email.";
            string actual;

            actual = ctrLandlordObj.AddFlat(mdlFlatObj.LandlordEmail, mdlFlatObj.Type, mdlFlatObj.Address,
                                            mdlFlatObj.PostCode, mdlFlatObj.City, mdlFlatObj.Rent, mdlFlatObj.Deposit, mdlFlatObj.AvailableFrom, mdlFlatObj.Description).Trim();
            Assert.AreEqual(expected, actual);
        }
Exemple #12
0
        public void UpdateLandlordProfileNonExistingEmail()
        {
            CtrLandlord ctrLandlordObj = new CtrLandlord();
            MdlLandlord mdlLandlordObj = GenerateLandlordObj();

            mdlLandlordObj.Email         = "*****@*****.**";
            mdlLandlordObj.Name          = "CompanyName";
            mdlLandlordObj.Country       = "Slovakia";
            mdlLandlordObj.City          = "Neslusa";
            mdlLandlordObj.PostCode      = "02341";
            mdlLandlordObj.Address       = "Neslusa 523";
            mdlLandlordObj.ContactPerson = "Miroslav Pakanec";

            bool expected = false;
            bool actual   = ctrLandlordObj.UpdateProfile(mdlLandlordObj);

            Assert.AreEqual(expected, actual);
        }
Exemple #13
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);
        }