public RarCompanyWrapper(RarCompany company) // : base(company) { if (company != null) { _Company = company; _LicenseList = new ObservableCollection <RarLicense>(company.LicenseList); } }
public void RarCompanyTests_ToString() { // arrange RarAdress adress = new RarAdress(); RarCompany company = new RarCompany("ID", "Company", "7701010101", "770101001", adress); // act string result = company.ToString(); //Assert Assert.AreEqual("Company ИНН:7701010101; КПП:770101001", result); }
public void RarCompanyTest_DefaultConstructor() { // arrange RarCompany company = new RarCompany(); // act //Assert Assert.IsTrue(company.ID != null); Assert.IsTrue(company.INN != null); Assert.IsTrue(company.KPP != null); Assert.AreEqual(false, company.IsUsed, "Is used"); Assert.IsNotNull(company.Adress); Assert.IsNotNull(company.LicenseList); }
public void RarCompanyTest_CopyConstructor() { // arrange RarAdress adress = new RarAdress(); RarCompany companyOrigin = new RarCompany("ID", "NAME", "INN", "KPP", adress); // act RarCompany company = new RarCompany(companyOrigin); //Assert Assert.AreEqual("ID", company.ID, "ID"); Assert.AreEqual("NAME", company.Name, "Name"); Assert.AreEqual("INN", company.INN, "INN"); Assert.AreEqual("KPP", company.KPP, "KPP"); Assert.AreEqual(false, company.IsUsed, "Is used"); Assert.AreEqual(adress, company.Adress, "Adress"); Assert.AreEqual(companyOrigin.LicenseList, company.LicenseList, "LisenceList"); }
public void RarCompanyTest_ConstructorWithArgs() { // arrange RarAdress adress = new RarAdress(); RarCompany company = new RarCompany("ID", "NAME", "INN", "KPP", adress); // act //Assert Assert.AreEqual("ID", company.ID, "ID"); Assert.AreEqual("NAME", company.Name, "Name"); Assert.AreEqual("INN", company.INN, "INN"); Assert.AreEqual("KPP", company.KPP, "KPP"); Assert.AreEqual(false, company.IsUsed, "Is used"); Assert.IsNotNull(company.Adress, "Adress"); Assert.IsNotNull(company.LicenseList, "LicensesList"); }
public void RarTurnoverDataTest_CopyConstructor() { // arrange DateTime date1 = DateTime.Parse("01.01.2016"); DateTime date2 = DateTime.Parse("02.01.2016"); RarSubdevision subdevision = new RarSubdevision(); RarCompany manufacturer = new RarCompany(); RarCompany buyer = new RarCompany(); RarLicense license = new RarLicense(); RarTurnoverData dataOrigin = new RarTurnoverData() { AlcoCode = "200", NotificationDate = date1, NotificationNumber = "N001", NotificationTurnover = 2.1, DocumentDate = date2, DocumentNumber = "D01", CustomsDeclarationNumber = "D001", Turnover = 1.0, Subdevision = subdevision, Manufacturer = manufacturer, Buyer = buyer, License = license }; // act RarTurnoverData data = new RarTurnoverData(dataOrigin); //Assert Assert.AreEqual("200", data.AlcoCode, "AlcoCode"); Assert.AreEqual(date1, data.NotificationDate, "NotificationDate"); Assert.AreEqual("N001", data.NotificationNumber, "NotificationNumber"); Assert.AreEqual(2.1, data.NotificationTurnover, "NotificationTurnover"); Assert.AreEqual(date2, data.DocumentDate, "DocumentDate"); Assert.AreEqual("D01", data.DocumentNumber, "DocumentNumber"); Assert.AreEqual("D001", data.CustomsDeclarationNumber, "CustomsDeclarationNumber"); Assert.AreEqual(1.0, data.Turnover, "Turnover"); Assert.AreSame(subdevision, data.Subdevision, "Subdevision"); Assert.AreSame(manufacturer, data.Manufacturer, "Manufacturer"); Assert.AreSame(buyer, data.Buyer, "Buyer"); Assert.AreSame(license, data.License, "License"); }
public void RarFormF6FormatterTest_SetupLisences() { // arrange string str = @"<Лицензии> <Лицензия ИдЛицензии=""11"" П000000000011=""18РПА0001901"" П000000000012=""31.08.2016"" П000000000013=""31.08.2018"" П000000000014=""Министерство промышленности и торговли""/> <Лицензия ИдЛицензии=""22"" П000000000011=""18РПА0001902"" П000000000012=""31.08.2016"" П000000000013=""31.08.2018"" П000000000014=""Министерство промышленности и торговли""/> <Лицензия ИдЛицензии=""33"" П000000000011=""18РПА0001903"" П000000000012=""31.08.2016"" П000000000013=""31.08.2018"" П000000000014=""Министерство промышленности и торговли""/> </Лицензии>"; XElement el = XDocument.Parse(str).Root; RarFormF6Formatter f6formatter = new RarFormF6Formatter(); var privateObject = new PrivateObject(f6formatter); RarCompany company = new RarCompany(); //act privateObject.Invoke("SetupLisences", el, company); List <RarLicense> lisenceList = company.LicenseList; int resultNumberOfLisences = lisenceList.Count; string resultID = lisenceList[0].ID; string resultSeriesNumber = lisenceList[0].SeriesNumber; DateTime resultDateFrom = lisenceList[0].DateFrom; DateTime resultDateTo = lisenceList[0].DateTo; string resultIssuer = lisenceList[0].Issuer; ////assert Assert.AreEqual(3, resultNumberOfLisences, "NumberOfLisences"); Assert.AreEqual("11", resultID, "ID"); Assert.AreEqual("18РПА0001901", resultSeriesNumber, "SeriesNumber"); Assert.AreEqual(DateTime.Parse("31.08.2016"), resultDateFrom, "DateFrom"); Assert.AreEqual(DateTime.Parse("31.08.2018"), resultDateTo, "DateTo"); Assert.AreEqual("Министерство промышленности и торговли", resultIssuer, "Issuer"); }
private void SetFakeData() { RarFormF6Data.DocumentDate = DateTime.Parse("23.01.2017"); RarFormF6Data.Version = "4.31"; RarFormF6Data.ProgramName = "1С:ПРЕДПРИЯТИЕ 8.3 УТ 11.2.3.203"; RarFormF6Data.FormNumber = "06"; RarFormF6Data.ReportPeriod = "0"; RarFormF6Data.ReportYear = "2013"; RarFormF6Data.CorrectionNumber = ""; RarFormF6Data.OurCompany.Name = "Наша фирма"; RarAdress adress1 = new RarAdress("643", "101111", "77", "Московский район", "Москва", "Московский район", "Уличная ул", "4б", "2/1", "А", "1"); RarAdress adress2 = new RarAdress("643", "101111", "77", "Московский район", "Москва", "Московский район", "Уличная ул", "4б", "2/1", "А", "2"); RarAdress adress3 = new RarAdress("643", "101111", "77", "Московский район", "Москва", "Московский район", "Уличная ул", "4б", "2/1", "А", "3"); RarSubdevision subdevision = new RarSubdevision() { Name = "Основное", KPP = "770101001" }; RarLicense license = new RarLicense() { SeriesNumber = "00009", DateFrom = DateTime.Parse("01.01.2015"), DateTo = DateTime.Parse("01.01.2018"), Issuer = "РАР" }; RarFormF6Data.BuyerList.Clear(); RarCompany buyer1 = new RarCompany() { Name = "ООО Одуванчик", INN = "7701010101", KPP = "770101011", Adress = adress1, ID = "01", IsUsed = false }; buyer1.LicenseList.Add(license); RarCompany buyer2 = new RarCompany() { Name = "ООО Ромашка", INN = "7701010102", KPP = "770101012" }; RarCompany buyer3 = new RarCompany() { Name = "ООО Василек", INN = "7701010103", KPP = "770101013" }; RarFormF6Data.BuyerList.Add(buyer1); RarFormF6Data.BuyerList.Add(buyer2); RarFormF6Data.BuyerList.Add(buyer3); RarFormF6Data.ManufacturerList.Clear(); RarCompany manufacturer1 = new RarCompany { Name = "Сибирский ЛВЗ", INN = "7701010101", KPP = "770101001" }; RarCompany manufacturer2 = new RarCompany { Name = "Производитель 2", INN = "7701010102", KPP = "770101002" }; RarCompany manufacturer3 = new RarCompany { Name = "Производитель 3", INN = "7701010103", KPP = "770101003" }; RarFormF6Data.ManufacturerList.Add(manufacturer1); RarFormF6Data.ManufacturerList.Add(manufacturer2); RarFormF6Data.ManufacturerList.Add(manufacturer3); RarFormF6Data.TurnoverDataList.Clear(); RarFormF6Data.TurnoverDataList.Add(new RarTurnoverData() { AlcoCode = "200", NotificationDate = DateTime.Parse("01.01.2017"), NotificationNumber = "213", NotificationTurnover = 0.005, DocumentDate = DateTime.Parse("01.01.2017"), DocumentNumber = "232", CustomsDeclarationNumber = "123213/09898/78979", Turnover = 0.005, Buyer = buyer1, Manufacturer = manufacturer1, Subdevision = subdevision, License = license }); RarFormF6Data.TurnoverDataList.Add(new RarTurnoverData() { AlcoCode = "200", NotificationDate = DateTime.Parse("01.01.2017"), NotificationNumber = "213", NotificationTurnover = 0.006, DocumentDate = DateTime.Parse("01.02.2017"), DocumentNumber = "238", CustomsDeclarationNumber = "123213/09898/78979", Turnover = 0.006, Buyer = buyer1, Manufacturer = manufacturer2, Subdevision = subdevision, License = license }); RarFormF6Data.TurnoverDataList.Add(new RarTurnoverData() { AlcoCode = "200", NotificationDate = DateTime.Parse("01.01.2017"), NotificationNumber = "212", NotificationTurnover = 0.008, DocumentDate = DateTime.Parse("01.03.2017"), DocumentNumber = "432", CustomsDeclarationNumber = "123213/09898/78979", Turnover = 0.008, Buyer = buyer2, Manufacturer = manufacturer3, Subdevision = subdevision, License = license }); }