Ejemplo n.º 1
0
        public void RarAdressTest_ConstructorStrictAdress()
        {
            // arrange
            RarAdress adress = new RarAdress("Strict adress");

            // act
            //Assert
            Assert.IsFalse(adress.StrictAdress);
            Assert.AreEqual("Strict adress", adress.AdressString, "Strict adress");
        }
Ejemplo n.º 2
0
        public void RarAdressTest_ToStringStrictAdress()
        {
            // arrange
            RarAdress adress = new RarAdress("Strict adress");
            // act
            string result = adress.ToString();

            //Assert
            Assert.AreEqual("Strict adress", result);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        public void RarSubdevisionTest_ToStringTest()
        {
            // arrange
            RarAdress      adress      = new RarAdress();
            RarSubdevision subdevision = new RarSubdevision("Subdevision", "770101001", adress);
            // act
            string result = subdevision.ToString();

            //Assert
            Assert.AreEqual("Subdevision КПП:770101001", result);
        }
Ejemplo n.º 5
0
        public void RarAdressTest_ToStringNonStrictAdress()
        {
            // arrange
            RarAdress adress = new RarAdress("Country", "PostCode", "RegionId", "District",
                                             "City", "Locality", "Street", "Building", "Block", "Litera", "Apartment");
            // act
            string result = adress.ToString();

            //Assert

            Assert.AreEqual("Country, PostCode, RegionId, District, City, Locality, Street, Building, Block, Litera, Apartment", result);
        }
Ejemplo n.º 6
0
        public void RarFormF6FormatterTest_SetupAdress()
        {
            // arrange
            string str =
                @"<АдрОрг>
                    <КодСтраны> 643 </КодСтраны>
                    <Индекс> 124460 </Индекс>
                    <КодРегион> 77 </КодРегион>
                    <Район> Московский </Район>
                    <Город> Зеленоград г </Город>
                    <НаселПункт> Пункт </НаселПункт>
                    <Улица> Западный 2-й проезд </Улица>
                    <Дом> 8 </Дом>
                    <Корпус> 12 </Корпус>
                    <Литера> Б </Литера>
                    <Кварт> 2 </Кварт>
              </АдрОрг>";

            XElement el = XDocument.Parse(str).Root;

            RarFormF6Formatter f6formatter = new RarFormF6Formatter();
            var privateObject = new PrivateObject(f6formatter);

            RarFormF6 formF6 = new RarFormF6();
            //act
            RarAdress adress = (RarAdress)privateObject.Invoke("SetupAdress", el);

            string resultCountryId = adress.CountryId;
            string resultPostCode  = adress.PostCode;
            string resultRegionId  = adress.RegionId;
            string resultDistrict  = adress.District;
            string resultCity      = adress.City;
            string resultLocality  = adress.Locality;
            string resultStreet    = adress.Street;
            string resultBuilding  = adress.Building;
            string resultBlock     = adress.Block;
            string resultLitera    = adress.Litera;
            string resultApartment = adress.Apartment;

            ////assert
            Assert.AreEqual("643", resultCountryId, "CountryId");
            Assert.AreEqual("124460", resultPostCode, "PostCode");
            Assert.AreEqual("77", resultRegionId, "RegionId");
            Assert.AreEqual("Московский", resultDistrict, "District");
            Assert.AreEqual("Зеленоград г", resultCity, "City");
            Assert.AreEqual("Пункт", resultLocality, "Locality");
            Assert.AreEqual("Западный 2-й проезд", resultStreet, "Street");
            Assert.AreEqual("12", resultBlock, "Block");
            Assert.AreEqual("Б", resultLitera, "Litera");
            Assert.AreEqual("8", resultBuilding, "Building");
            Assert.AreEqual("2", resultApartment, "Apartment");
        }
Ejemplo n.º 7
0
        public void RarSubdevisionTest_CopyConstructor()
        {
            // arrange
            RarAdress      adress            = new RarAdress();
            RarSubdevision subdevisionOrigin = new RarSubdevision("Name", "KPP", adress);
            // act
            RarSubdevision subdevision = new RarSubdevision(subdevisionOrigin);

            //Assert
            Assert.AreEqual("Name", subdevision.Name, "Name");
            Assert.AreEqual("KPP", subdevision.KPP, "KPP");
            Assert.AreEqual(adress, subdevision.Adress, "Adress");
        }
Ejemplo n.º 8
0
        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");
        }
Ejemplo n.º 9
0
        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");
        }
Ejemplo n.º 10
0
        public void RarAdressTest_ConstructorWithNullProperties()
        {
            // arrange
            RarAdress adress = new RarAdress(null, null, null, null, null, null, null, null, null, null, null);

            // act

            //Assert
            Assert.IsTrue(adress.CountryId != null);
            Assert.IsTrue(adress.PostCode != null);
            Assert.IsTrue(adress.RegionId != null);
            Assert.IsTrue(adress.District != null);
            Assert.IsTrue(adress.City != null);
            Assert.IsTrue(adress.Locality != null);
            Assert.IsTrue(adress.Street != null);
            Assert.IsTrue(adress.Building != null);
            Assert.IsTrue(adress.Block != null);
            Assert.IsTrue(adress.Litera != null);
            Assert.IsTrue(adress.Apartment != null);
        }
Ejemplo n.º 11
0
        public void RarAdressTest_CopyConstructor()
        {
            // arrange
            RarAdress adressOrigin = new RarAdress("Country", "PostCode", "RegionId", "District",
                                                   "City", "Locality", "Street", "Building", "Block", "Litera", "Apartment");
            // act
            RarAdress adress = new RarAdress(adressOrigin);

            //Assert
            Assert.AreEqual("Country", adress.CountryId, "Country");
            Assert.AreEqual("PostCode", adress.PostCode, "PostCode");
            Assert.AreEqual("RegionId", adress.RegionId, "RegionId");
            Assert.AreEqual("District", adress.District, "District");
            Assert.AreEqual("City", adress.City, "City");
            Assert.AreEqual("Locality", adress.Locality, "Locality");
            Assert.AreEqual("Street", adress.Street, "Street");
            Assert.AreEqual("Building", adress.Building, "Building");
            Assert.AreEqual("Block", adress.Block, "Block");
            Assert.AreEqual("Litera", adress.Litera, "Litera");
            Assert.AreEqual("Apartment", adress.Apartment, "Apartment");
            Assert.IsTrue(adress.StrictAdress);
        }
Ejemplo n.º 12
0
        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
            });
        }