Example #1
0
        public void employingPurchasersTest()
        {
            PersonalAssistantDAO paDao      = new PersonalAssistantDAO();
            PurchaserDataDAO     pdDao      = new PurchaserDataDAO();
            PersonalAssistant    originalPa = pa;

            originalPa = paDao.insert(originalPa);
            idToDelete = originalPa.Id;
            List <PurchaserData> purs = pdDao.SelectAll();

            if (purs == null || purs.Count == 0)
            {
                Assert.Fail("Can not add purchaser to personal assistants purchasersList");
            }
            Purchaser p = purs[0].Purchaser;

            paDao.insertEmploymentStatus(p, originalPa);

            //when
            paDao.selectPurchaserList(originalPa);

            //then
            Assert.IsNotNull(originalPa.Purchasers);
            Assert.AreEqual(originalPa.Purchasers.Count, 1);
            Assert.AreEqual(originalPa.Purchasers[0].Id, p.Id);
        }
Example #2
0
        public void SelectAllTestPurchaserData()
        {
            //given (see setUp)
            PurchaserDataDAO pdDao       = new PurchaserDataDAO();
            PurchaserData    originalPur = d;
            long             id          = pdDao.Insert(originalPur).Purchaser.Id;

            idToDelete = id;
            //when
            List <PurchaserData> pds = pdDao.SelectAll();

            //then
            foreach (PurchaserData pd in pds)
            {
                if (pd.Purchaser.Id == id)
                {
                    Assert.AreEqual(pd.Purchaser.FirstName, "testpersonDao");
                    Assert.AreEqual(pd.Purchaser.LastName, "testpersonDao");
                    Assert.AreEqual(pd.Purchaser.PhoneNumber, "9999");
                    Assert.AreEqual(pd.Purchaser.MobilePhone, "99999");
                    Assert.AreEqual(pd.Purchaser.EMail, "*****@*****.**");
                    Assert.AreEqual(pd.Purchaser.HomeAdress.Street, "Am Hügel");
                    Assert.AreEqual(pd.Purchaser.HomeAdress.HouseNumber, 12);
                    Assert.AreEqual(pd.Purchaser.HomeAdress.City, "LINZ");
                    Assert.AreEqual(pd.Purchaser.HomeAdress.Country, "schland");
                    Assert.AreEqual(pd.Purchaser.HomeAdress.DoorNumber, 11115);
                    Assert.AreEqual(pd.Purchaser.HomeAdress.StairNumber, 2345);
                    Assert.AreEqual(pd.Purchaser.HomeAdress.Etage, 2);
                    Assert.AreEqual(pd.Purchaser.HomeAdress.ZipCode, 5040);
                    Assert.AreEqual(pd.Purchaser.IBAN, "AT1254859888898");
                    Assert.AreEqual(pd.Purchaser.BIC, "SPPR2586XX");
                    Assert.AreEqual(pd.Purchaser.AccountHolder, "Helmut Günther");
                    Assert.AreEqual(pd.Purchaser.SVN, 1225020496);
                    Assert.AreEqual(pd.Purchaser.nationality, "Auenland");
                    Assert.AreEqual(pd.Purchaser.InfoField, "Infotext");

                    //purchaser
                    Assert.AreEqual(pd.Purchaser.Active, true);
                    Assert.AreEqual(pd.Purchaser.ApprovalBegin, new DateTime(2015, 05, 02));
                    Assert.AreEqual(pd.Purchaser.ApprovalEnd, new DateTime(2017, 05, 02));
                    Assert.AreEqual(pd.Purchaser.EntryDate, new DateTime(2015, 05, 02));
                    Assert.AreEqual(pd.Purchaser.hasContract, true);
                    Assert.AreEqual(pd.Purchaser.hasIntroCourse, true);
                    Assert.AreEqual(pd.Purchaser.DistrictCommision, "Perg");

                    //purchaserData
                    Assert.AreEqual(pd.AssistenceDemand, 12);
                    Assert.AreEqual(pd.CareAllowance, 2);
                    Assert.AreEqual(pd.HourlyRate, 30);
                    Assert.AreEqual(pd.HourlyRatePayoff, 20);
                    Assert.AreEqual(pd.Income, 29);
                    Assert.AreEqual(pd.InputIncome, 100);
                    Assert.AreEqual(pd.Month, 11);
                    Assert.AreEqual(pd.TravellingAllowance, 12);
                    Assert.AreEqual(pd.TravellingAllowanceKM, 11);
                    //Assert.AreEqual(pd.CareAllowanceMaximum, 16);
                    Assert.AreEqual(pd.Year, 2015);
                }
            }
        }
Example #3
0
        private void FillGlobals()
        {
            PurchaserDataDAO     pdao       = new PurchaserDataDAO();
            List <PurchaserData> purchasers = pdao.SelectAll();

            PayperHour.Text         = purchasers[0].HourlyRate.ToString();
            billablePayperHour.Text = purchasers[0].HourlyRatePayoff.ToString();
            KmPay.Text = purchasers[0].TravellingAllowanceKM.ToString();
        }