public void employementTimesTest() { PersonalAssistantDAO paDao = new PersonalAssistantDAO(); PurchaserDataDAO pdDao = new PurchaserDataDAO(); PurchaserData originalPd = d; originalPd = pdDao.Insert(originalPd); idToDelete = originalPd.Purchaser.Id; List <PersonalAssistant> pas = paDao.SelectAll(); if (pas == null || pas.Count == 0) { Assert.Fail("Can not find personal assistants to add to purchasers employmentTimes"); } PersonalAssistant pa = pas[0]; Purchaser p = originalPd.Purchaser; paDao.insertEmploymentStatus(p, pa); //when PurchaserDAO purDao = new PurchaserDAO(); List <EmploymentStatus> empList = purDao.SelectEmploymentStatusList(p); //then Assert.IsNotNull(empList); Assert.AreEqual(empList.Count, 1); Assert.AreEqual(empList[0].Purchaser.Id, p.Id); Assert.AreEqual(empList[0].Assistant.Id, pa.Id); }
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); } } }
public void InsertEffortEntry() { //given pa = paDao.insert(pa); d = pdDao.Insert(d); mbDao.InsertMonthlyBilling(mb); //when eeDao.InsertEntry(effortEntries[0]); eeDao.InsertEntry(effortEntries[1]); //then List <EffortEntry> ees = eeDao.GetEntries(mb.Pa.Id, mb.Pur.Purchaser.Id, mb.Month, mb.Year); Assert.AreEqual(ees.Count, 2); Assert.AreEqual(ees[0].A1.Name, Activity.State.Begleitung); Assert.AreEqual(ees[0].A2.Name, Activity.State.Hauswirtschaft); Assert.AreEqual(ees[0].Km, 10); Assert.AreEqual(ees[0].From.Hour, 12); Assert.AreEqual(ees[0].From.Minute, 30); Assert.AreEqual(ees[0].To.Hour, 18); Assert.AreEqual(ees[0].To.Minute, 45); }
public void UpdatePurchaserDataTest() { PurchaserDataDAO pdDao = new PurchaserDataDAO(); PurchaserData originalPur = d; PurchaserData pd = new PurchaserData(); PurchaserData p = pdDao.Insert(originalPur); idToDelete = p.Purchaser.Id; //Person Insert p.Purchaser.FirstName = "Hermann"; p.Purchaser.LastName = "Mayr"; p.Purchaser.PhoneNumber = "1111"; p.Purchaser.MobilePhone = "1111"; p.Purchaser.EMail = "*****@*****.**"; p.Purchaser.HomeAdress.Street = "Am Tal"; p.Purchaser.HomeAdress.HouseNumber = 2; p.Purchaser.HomeAdress.City = "LINZKeks"; p.Purchaser.HomeAdress.Country = "schiachland"; p.Purchaser.HomeAdress.DoorNumber = 2222; p.Purchaser.HomeAdress.StairNumber = 1; p.Purchaser.HomeAdress.Etage = 1; p.Purchaser.HomeAdress.ZipCode = 54; p.Purchaser.IBAN = "DE2554859888898"; p.Purchaser.BIC = "RAPR2586XX"; p.Purchaser.AccountHolder = "Herman Günther"; p.Purchaser.SVN = 3525020496; p.Purchaser.nationality = "BAuenland"; p.Purchaser.InfoField = "Infotext erweitert"; //purchaser p.Purchaser.Active = false; p.Purchaser.ApprovalBegin = new DateTime(2016, 06, 08); p.Purchaser.ApprovalEnd = new DateTime(2018, 08, 09); p.Purchaser.EntryDate = new DateTime(2018, 04, 07); p.Purchaser.hasContract = false; p.Purchaser.hasIntroCourse = false; p.Purchaser.DistrictCommision = "Freistadt"; //purchaserData p.AssistenceDemand = 225; p.CareAllowance = 84; p.HourlyRate = 26; p.HourlyRatePayoff = 12; p.Income = 2900; p.InputIncome = 1000; p.Month = 11; p.TravellingAllowance = 13; p.TravellingAllowanceKM = 25; p.CareAllowanceMaximum = 18; p.Year = 2015; pdDao.Update(p); p = new PurchaserData(); p.Purchaser = new Purchaser(); p.Purchaser.Id = idToDelete; pdDao.Select(p); //Person Insert Assert.AreEqual(p.Purchaser.FirstName, "Hermann"); Assert.AreEqual(p.Purchaser.LastName, "Mayr"); Assert.AreEqual(p.Purchaser.PhoneNumber, "1111"); Assert.AreEqual(p.Purchaser.MobilePhone, "1111"); Assert.AreEqual(p.Purchaser.EMail, "*****@*****.**"); Assert.AreEqual(p.Purchaser.HomeAdress.Street, "Am Tal"); Assert.AreEqual(p.Purchaser.HomeAdress.HouseNumber, 2); Assert.AreEqual(p.Purchaser.HomeAdress.City, "LINZKeks"); Assert.AreEqual(p.Purchaser.HomeAdress.Country, "schiachland"); Assert.AreEqual(p.Purchaser.HomeAdress.DoorNumber, 2222); Assert.AreEqual(p.Purchaser.HomeAdress.StairNumber, 1); Assert.AreEqual(p.Purchaser.HomeAdress.Etage, 1); Assert.AreEqual(p.Purchaser.HomeAdress.ZipCode, 54); Assert.AreEqual(p.Purchaser.IBAN, "DE2554859888898"); Assert.AreEqual(p.Purchaser.BIC, "RAPR2586XX"); Assert.AreEqual(p.Purchaser.AccountHolder, "Herman Günther"); Assert.AreEqual(p.Purchaser.SVN, 3525020496); Assert.AreEqual(p.Purchaser.nationality, "BAuenland"); Assert.AreEqual(p.Purchaser.InfoField, "Infotext erweitert"); //purchaser Assert.AreEqual(p.Purchaser.Active, false); Assert.AreEqual(p.Purchaser.ApprovalBegin, new DateTime(2016, 06, 08)); Assert.AreEqual(p.Purchaser.ApprovalEnd, new DateTime(2018, 08, 09)); Assert.AreEqual(p.Purchaser.EntryDate, new DateTime(2018, 04, 07)); Assert.AreEqual(p.Purchaser.hasContract, false); Assert.AreEqual(p.Purchaser.hasIntroCourse, false); Assert.AreEqual(p.Purchaser.DistrictCommision, "Freistadt"); //purchaserData Assert.AreEqual(p.AssistenceDemand, 225); Assert.AreEqual(p.CareAllowance, 84); Assert.AreEqual(p.HourlyRate, 26); Assert.AreEqual(p.HourlyRatePayoff, 12); Assert.AreEqual(p.Income, 2900); Assert.AreEqual(p.InputIncome, 1000); Assert.AreEqual(p.Month, 11); Assert.AreEqual(p.TravellingAllowance, 13); Assert.AreEqual(p.TravellingAllowanceKM, 25); Assert.AreEqual(p.Year, 2015); }
public static void setUp(TestContext testContext) { eeDao = new EffortEntryDAO(); mbDao = new MonthlyBillingDAO(); pdDao = new PurchaserDataDAO(); paDao = new PersonalAssistantDAO(); Purchaser p = new Purchaser(); //Person Insert p.FirstName = "testpersonDao"; p.LastName = "testpersonDao"; p.PhoneNumber = "9999"; p.MobilePhone = "99999"; p.EMail = "*****@*****.**"; p.HomeAdress.Street = "Am Hügel"; p.HomeAdress.HouseNumber = 12; p.HomeAdress.City = "LINZ"; p.HomeAdress.Country = "schland"; p.HomeAdress.DoorNumber = 11115; p.HomeAdress.StairNumber = 2345; p.HomeAdress.Etage = 2; p.HomeAdress.ZipCode = 5040; p.IBAN = "AT1254859888898"; p.BIC = "SPPR2586XX"; p.AccountHolder = "Helmut Günther"; p.SVN = 1225020496; p.nationality = "Auenland"; p.InfoField = "Infotext"; //purchaser p.Active = true; p.ApprovalBegin = new DateTime(2015, 05, 02); p.ApprovalEnd = new DateTime(2017, 05, 02); p.EntryDate = new DateTime(2015, 05, 02); p.hasContract = true; p.hasIntroCourse = true; p.DistrictCommision = "Perg"; //purchaserData d = new PurchaserData(); d.Purchaser = p; d.AssistenceDemand = 12; d.CareAllowance = 2; d.HourlyRate = 30; d.HourlyRatePayoff = 20; d.Income = 29; d.InputIncome = 100; d.Month = 11; d.TravellingAllowance = 12; d.TravellingAllowanceKM = 11; d.CareAllowanceMaximum = 16; d.Year = 1998; pa = new PersonalAssistant(); //Person Insert pa.FirstName = "persöhnlicher"; pa.LastName = "assistent"; pa.PhoneNumber = "9999"; pa.MobilePhone = "99999"; pa.EMail = "*****@*****.**"; pa.HomeAdress.Street = "Am Hügel"; pa.HomeAdress.HouseNumber = 12; pa.HomeAdress.City = "LINZ"; pa.HomeAdress.Country = "schland"; pa.HomeAdress.DoorNumber = 11115; pa.HomeAdress.StairNumber = 2345; pa.HomeAdress.Etage = 2; pa.HomeAdress.ZipCode = 5040; pa.IBAN = "AT1254859888898"; pa.BIC = "SPPR2586XX"; pa.AccountHolder = "Helmut Günther"; pa.SVN = 1225020496; pa.nationality = "Auenland"; pa.InfoField = "Infotext"; //pa pa.Active = true; pa.ClosingDateDocuments = new DateTime(2016, 02, 03); pa.SV = true; pa.Dienstvertrag = true; pa.BestBH = true; pa.Grundkurs = true; pa.consumedHours = 2.4M; pa.deadLineHours = new DateTime(2017, 02, 04); pa = paDao.insert(pa); d = pdDao.Insert(d); mb = new MonthlyBillingPerPa(); mb.PrivateKm = 21; mb.Month = 7; mb.Year = 1998; mb.Pa = pa; mb.Pur = d; mb.WorkingHours = 15; mb.BillableKm = 10; effortEntries = new List <EffortEntry>(); EffortEntry a = new EffortEntry(); a.Month = mb.Month; a.Year = mb.Year; a.Pa = mb.Pa; a.Purchaser = mb.Pur.Purchaser; a.Day = 1; a.From = new DateTime(a.Year, a.Month, a.Day, 12, 30, 0); a.To = new DateTime(a.Year, a.Month, a.Day, 18, 45, 0); a.Km = 10; a.A1 = new Activity(Activity.State.Begleitung); a.A2 = new Activity(Activity.State.Hauswirtschaft); EffortEntry b = new EffortEntry(); b.Month = mb.Month; b.Year = mb.Year; b.Pa = mb.Pa; b.Purchaser = mb.Pur.Purchaser; b.Day = 2; b.From = new DateTime(b.Year, b.Month, b.Day, 12, 30, 0); b.To = new DateTime(b.Year, b.Month, b.Day, 18, 45, 0); b.Km = 10; b.A1 = new Activity(Activity.State.Begleitung); b.A2 = new Activity(Activity.State.Hauswirtschaft); effortEntries.Add(a); effortEntries.Add(b); }
public void InsertMBEntry() { //given pa = paDao.insert(pa); d = pdDao.Insert(d); //when mbDao.InsertMonthlyBilling(mb); //then mb = mbDao.selectMBEntry(mb); Assert.AreEqual(mb.Pur.Purchaser.FirstName, "testpersonDao"); Assert.AreEqual(mb.Pur.Purchaser.LastName, "testpersonDao"); Assert.AreEqual(mb.Pur.Purchaser.PhoneNumber, "9999"); Assert.AreEqual(mb.Pur.Purchaser.MobilePhone, "99999"); Assert.AreEqual(mb.Pur.Purchaser.EMail, "*****@*****.**"); Assert.AreEqual(mb.Pur.Purchaser.HomeAdress.Street, "Am Hügel"); Assert.AreEqual(mb.Pur.Purchaser.HomeAdress.HouseNumber, 12); Assert.AreEqual(mb.Pur.Purchaser.HomeAdress.City, "LINZ"); Assert.AreEqual(mb.Pur.Purchaser.HomeAdress.Country, "schland"); Assert.AreEqual(mb.Pur.Purchaser.HomeAdress.DoorNumber, 11115); Assert.AreEqual(mb.Pur.Purchaser.HomeAdress.StairNumber, 2345); Assert.AreEqual(mb.Pur.Purchaser.HomeAdress.Etage, 2); Assert.AreEqual(mb.Pur.Purchaser.HomeAdress.ZipCode, 5040); Assert.AreEqual(mb.Pur.Purchaser.IBAN, "AT1254859888898"); Assert.AreEqual(mb.Pur.Purchaser.BIC, "SPPR2586XX"); Assert.AreEqual(mb.Pur.Purchaser.AccountHolder, "Helmut Günther"); Assert.AreEqual(mb.Pur.Purchaser.SVN, 1225020496); Assert.AreEqual(mb.Pur.Purchaser.nationality, "Auenland"); Assert.AreEqual(mb.Pur.Purchaser.InfoField, "Infotext"); //purchaser Assert.AreEqual(mb.Pur.Purchaser.Active, true); Assert.AreEqual(mb.Pur.Purchaser.ApprovalBegin, new DateTime(2015, 05, 02)); Assert.AreEqual(mb.Pur.Purchaser.ApprovalEnd, new DateTime(2017, 05, 02)); Assert.AreEqual(mb.Pur.Purchaser.EntryDate, new DateTime(2015, 05, 02)); Assert.AreEqual(mb.Pur.Purchaser.hasContract, true); Assert.AreEqual(mb.Pur.Purchaser.hasIntroCourse, true); Assert.AreEqual(mb.Pur.Purchaser.DistrictCommision, "Perg"); //purchaserData Assert.AreEqual(mb.Pur.AssistenceDemand, 12); Assert.AreEqual(mb.Pur.CareAllowance, 2); Assert.AreEqual(mb.Pur.HourlyRate, 30); Assert.AreEqual(mb.Pur.HourlyRatePayoff, 20); Assert.AreEqual(mb.Pur.Income, 29); Assert.AreEqual(mb.Pur.InputIncome, 100); Assert.AreEqual(mb.Pur.Month, 11); Assert.AreEqual(mb.Pur.TravellingAllowance, 12); Assert.AreEqual(mb.Pur.TravellingAllowanceKM, 11); Assert.AreEqual(mb.Pur.CareAllowanceMaximum, 16); Assert.AreEqual(mb.Pur.Year, 1998); //Person Insert Assert.AreEqual(mb.Pa.FirstName, "persöhnlicher"); Assert.AreEqual(mb.Pa.LastName, "assistent"); Assert.AreEqual(mb.Pa.PhoneNumber, "9999"); Assert.AreEqual(mb.Pa.MobilePhone, "99999"); Assert.AreEqual(mb.Pa.EMail, "*****@*****.**"); Assert.AreEqual(mb.Pa.HomeAdress.Street, "Am Hügel"); Assert.AreEqual(mb.Pa.HomeAdress.HouseNumber, 12); Assert.AreEqual(mb.Pa.HomeAdress.City, "LINZ"); Assert.AreEqual(mb.Pa.HomeAdress.Country, "schland"); Assert.AreEqual(mb.Pa.HomeAdress.DoorNumber, 11115); Assert.AreEqual(mb.Pa.HomeAdress.StairNumber, 2345); Assert.AreEqual(mb.Pa.HomeAdress.Etage, 2); Assert.AreEqual(mb.Pa.HomeAdress.ZipCode, 5040); Assert.AreEqual(mb.Pa.IBAN, "AT1254859888898"); Assert.AreEqual(mb.Pa.BIC, "SPPR2586XX"); Assert.AreEqual(mb.Pa.AccountHolder, "Helmut Günther"); Assert.AreEqual(mb.Pa.SVN, 1225020496); Assert.AreEqual(mb.Pa.nationality, "Auenland"); Assert.AreEqual(mb.Pa.InfoField, "Infotext"); //pa Assert.AreEqual(mb.Pa.Active, true); Assert.AreEqual(mb.Pa.ClosingDateDocuments, new DateTime(2016, 02, 03)); Assert.AreEqual(mb.Pa.SV, true); Assert.AreEqual(mb.Pa.Dienstvertrag, true); Assert.AreEqual(mb.Pa.BestBH, true); Assert.AreEqual(mb.Pa.Grundkurs, true); Assert.AreEqual(mb.Pa.consumedHours, 2.4M); Assert.AreEqual(mb.Pa.deadLineHours, new DateTime(2017, 02, 04)); Assert.AreEqual(mb.PrivateKm, 21); Assert.AreEqual(mb.Month, 5); Assert.AreEqual(mb.Year, 1998); Assert.AreEqual(mb.Pa, pa); Assert.AreEqual(mb.Pur, d); Assert.AreEqual(mb.WorkingHours, 15); Assert.AreEqual(mb.BillableKm, 10); }