예제 #1
0
        private Document CreateSimpleDoument()
        {
            var counterPartyLogic = new CounterPartyLogic(_jsonLogic);
            var cityLogic         = new CityLogic(_jsonLogic);

            var senderCityRef = cityLogic.GetCityByName("Одесса").Ref;
            var senderRef     = counterPartyLogic.GetSenderCounterpartyRef();
            var senderContact = counterPartyLogic.GetCounterpartyFirstContactWithEmail(senderRef).Ref;

            var recipientCityRef   = cityLogic.GetCityByName("Киев").Ref;
            var recipientPhone     = "0934502712";
            var recipientFirstName = "Вася";
            var recipientLastName  = "Пупкин";

            var recipient = counterPartyLogic.CreateConterparty(new CounterParty()
            {
                FirstName            = recipientFirstName,
                LastName             = recipientLastName,
                Phone                = recipientPhone,
                CityRef              = recipientCityRef,
                CounterpartyType     = "PrivatePerson",
                CounterpartyProperty = "Recipient"
            });

            var document = new Document()
            {
                Ref              = null,
                SendersPhone     = "380934502711",
                CitySender       = senderCityRef,
                ContactSender    = senderContact,
                ServiceType      = "WarehouseDoors",
                PayerType        = "Sender",
                PaymentMethod    = "Cash",
                DateTime         = DateTime.Now,
                CargoType        = "Cargo",
                SeatsAmount      = 1,
                Weight           = 0.3,
                VolumeGeneral    = 0.001,
                Description      = "аксесуари до мобільних пристроїв",
                Cost             = 123,
                Sender           = senderRef.Value,
                SenderAddress    = new Guid("5A39E590-E1C2-11E3-8C4A-0050568002CF"),
                CityRecipient    = recipientCityRef,
                Recipient        = recipient.Ref.Value,
                RecipientAddress = new Guid("7B422FA4-E1B8-11E3-8C4A-0050568002CF"),
                ContactRecipient = recipient.ContactPerson.data[0].Ref.Value,
                RecipientsPhone  = recipientPhone
            };

            return(document);
        }
예제 #2
0
        public void GetCityByNameTest()
        {
            var cl   = new CityLogic(_jsonLogic);
            var city = cl.GetCityByName("Одесса");

            Assert.AreEqual(city.DescriptionRu, "Одесса");
        }