public void InsertAssociateTest() { Random random = new Random(); Region region = new Region(connManager); region.Code = "RUT"; region.Name = "UTRegion"; region.Rank = random.Next(100000, 110000); region.SetNew(); region.Id = region.Save(); Currency currency = new Currency(connManager); currency.Code = "UTCode"; currency.Name = "UTCurrency"; currency.SetNew(); currency.Id = currency.Save(); Country country = new Country(connManager); country.Code = "UTCode"; country.Name = "UTCountry"; country.IdCurrency = currency.Id; country.IdRegion = region.Id; country.Rank = random.Next(100000, 110000); country.SetNew(); country.Id = country.Save(); Associate associate = new Associate(connManager); associate.IdCountry = country.Id; associate.EmployeeNumber = "UTEmployeeNumber"; associate.Name = "UTAssociateName"; associate.InergyLogin = "******"; associate.PercentageFullTime = 100; associate.IsActive = true; associate.IsSubContractor = true; associate.SetNew(); associate.Id = associate.Save(); Assert.Greater(associate.Id, 0); associate.SetDeleted(); associate.Save(); BLTestUtils.DeleteCountryGLAccounts(country.Id, connManager); country.SetDeleted(); country.Save(); currency.SetDeleted(); currency.Save(); region.SetDeleted(); region.Save(); }
public void InsertInergyLocationTest() { Random random = new Random(); Region region = new Region(connManager); region.Name = "UTRegion"; region.Code = "UTCode"; region.Rank = random.Next(100000, 110000); region.SetNew(); region.Id = region.Save(); Currency currency = new Currency(connManager); currency.Code = "UTCode"; currency.Name = "UTCurrency"; currency.SetNew(); currency.Id = currency.Save(); Country country = new Country(connManager); country.Code = "UTCode"; country.Name = "UTCountry"; country.IdCurrency = currency.Id; country.IdRegion = region.Id; country.Rank = random.Next(100000, 110000); country.SetNew(); country.Id = country.Save(); InergyLocation inergyLocation = new InergyLocation(connManager); inergyLocation.IdCountry = country.Id; inergyLocation.Code = "UTCode"; inergyLocation.Name = "UTName"; inergyLocation.Rank = random.Next(100000, 110000); inergyLocation.SetNew(); inergyLocation.Id = inergyLocation.Save(); Assert.Greater(country.Id, 0); inergyLocation.SetDeleted(); inergyLocation.Save(); BLTestUtils.DeleteCountryGLAccounts(country.Id, connManager); country.SetDeleted(); country.Save(); currency.SetDeleted(); currency.Save(); region.SetDeleted(); region.Save(); }
public void InsertCountryTest() { Random random = new Random(); Country country = new Country(connManager); country.Code = Guid.NewGuid().ToString().Substring(0, 3); country.Name = "UTCountry " + Guid.NewGuid().ToString(); country.IdCurrency = random.Next(1, 1); country.IdRegion = random.Next(1, 3); country.Rank = random.Next(100000, 110000); country.SetNew(); country.Id = country.Save(); Assert.Greater(country.Id, 0); BLTestUtils.DeleteCountryGLAccounts(country.Id, connManager); country.SetDeleted(); country.Save(); }
public void InsertHourlyRateTest() { Random random = new Random(); Region region = new Region(connManager); region.Name = "UTRegion"; region.Code = "UTCode"; region.Rank = random.Next(100000, 110000); region.SetNew(); region.Id = region.Save(); Currency currency = new Currency(connManager); currency.Code = "UTCode"; currency.Name = "UTCurrency"; currency.SetNew(); currency.Id = currency.Save(); Country country = new Country(connManager); country.Code = "UTCode"; country.Name = "UTCountry"; country.IdCurrency = currency.Id; country.IdRegion = region.Id; country.Rank = random.Next(100000, 110000); country.SetNew(); country.Id = country.Save(); InergyLocation inergyLocation = new InergyLocation(connManager); inergyLocation.IdCountry = country.Id; inergyLocation.Code = "UTCode"; inergyLocation.Name = "UTName"; inergyLocation.Rank = random.Next(100000, 110000); inergyLocation.SetNew(); inergyLocation.Id = inergyLocation.Save(); Department department = new Department(connManager); department.IdFunction = 1; department.Name = "UTDepartment"; department.Rank = random.Next(100000, 110000); department.SetNew(); department.Id = department.Save(); CostCenter costCenter = new CostCenter(connManager); costCenter.IdInergyLocation = inergyLocation.Id; costCenter.IdDepartment = department.Id; costCenter.IsActive = true; costCenter.Code = "UTCode"; costCenter.Name = "UTName"; costCenter.SetNew(); costCenter.Id = costCenter.Save(); HourlyRate hourlyRate = new HourlyRate(connManager); hourlyRate.IdCostCenter = costCenter.Id; hourlyRate.IdCurrency = currency.Id; hourlyRate.YearMonth = 199010; hourlyRate.Value = 1.5M; hourlyRate.SetNew(); hourlyRate.Id = hourlyRate.Save(); hourlyRate.SetDeleted(); hourlyRate.Save(); costCenter.SetDeleted(); costCenter.Save(); department.SetDeleted(); department.Save(); inergyLocation.SetDeleted(); inergyLocation.Save(); BLTestUtils.DeleteCountryGLAccounts(country.Id, connManager); country.SetDeleted(); country.Save(); currency.SetDeleted(); currency.Save(); region.SetDeleted(); region.Save(); }