Example #1
0
        public string AddLandlord(MdlLandlord mdlLandlordObj)
        {
            ctrLandlordObj = new CtrLandlord();

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

            return ctrLandlordObj.AddLandlord(mdlLandlordObj);
        }
Example #2
0
        public void AddNewFlatWrongLandlordCtr()
        {
            bool actualResult = true;
            bool expectedResult = false;

            CtrLandlord ctrLandlordObj = new CtrLandlord();
            actualResult = ctrLandlordObj.AddApartment("*****@*****.**", "flat", "address", "zipCode", 2000.0, 6000.0, DateTime.Now, DateTime.Now, "Flat description");

            Assert.AreEqual(expectedResult, actualResult);
        }
Example #3
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);
        }
Example #4
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);
        }
Example #5
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);
        }
Example #6
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);
        }
Example #7
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);
        }
Example #8
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);
        }
Example #9
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);
        }
Example #10
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);
        }
Example #11
0
 public void CheckEmailTest()
 {
     CtrLandlord ctrLandlord = new CtrLandlord();
     //should return true
     Assert.IsTrue(ctrLandlord.AddLandlord("*****@*****.**", "pass", true, DateTime.Now, "Miro", "Pakanec", "xxx", "f**k", "aalborg", "Denmark", "4546456465"));
 }
Example #12
0
 public void GetNonExistingLandlordData()
 {
     CtrLandlord ctrLandlordObj = new CtrLandlord();
     MdlLandlord mdlLandlordObj = ctrLandlordObj.GetLandlordData("*****@*****.**");
     Assert.IsNull(mdlLandlordObj.ContactPerson);
 }
Example #13
0
        public MdlLandlord GetLandlordData(string email)
        {
            ctrLandlordObj = new CtrLandlord();

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

            return ctrLandlordObj.GetLandlordData(email);
        }
Example #14
0
        public DataSet GetFlatsLandlord(string landlordEmail)
        {
            ctrLandlordObj = new CtrLandlord();

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

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

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

            return ctrLandlordObj.UpdateProfile(mdlLandlordObj);
        }