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

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

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

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

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

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

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

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

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

            return(ctrLandlordObj.GetLandlordData(email));
        }
コード例 #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);
        }
コード例 #7
0
ファイル: FlatTestes.cs プロジェクト: Teo27/Eflats
        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);
        }
コード例 #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));
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #11
0
ファイル: FlatTestes.cs プロジェクト: Teo27/Eflats
        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);
        }
コード例 #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);
        }
コード例 #13
0
ファイル: ConfirmedTests.cs プロジェクト: Teo27/Eflats
        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);
        }