Example #1
0
        public void GetCounterPartyContactPersonsTest()
        {
            var cl     = new CounterPartyLogic(_jsonLogic);
            var result = cl.GetCounterpartyContactPersonsByCounterpartyRef(new Guid("f5cb6305-37a8-11e6-a54a-005056801333")).Count();

            Assert.Greater(result, 10);
        }
Example #2
0
        public void GetRecipientCounterPartyTest()
        {
            var cl     = new CounterPartyLogic(_jsonLogic);
            var result = cl.GetReciepentCounterParties();

            Assert.AreEqual(result.FirstOrDefault().OwnershipFormDescription, "Фізична особа");
        }
Example #3
0
        public void GetSenderRefTest()
        {
            var cl     = new CounterPartyLogic(_jsonLogic);
            var result = cl.GetSenderCounterpartyRef();

            Assert.AreEqual(result, new Guid("361ce04b92c711e6a54a005056801333"));
        }
Example #4
0
        public void GetSenderContactPersonsByRefTest()
        {
            var cl     = new CounterPartyLogic(_jsonLogic);
            var result = cl.GetCounterpartyContactPersonsByCounterpartyRef(new Guid("361ce04b92c711e6a54a005056801333"));

            Assert.Greater(result.Count(), 0);
        }
Example #5
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);
        }
Example #6
0
        public void DeleteNonExistingCounterPartyTest()
        {
            var cl = new CounterPartyLogic(_jsonLogic);

            try
            {
                cl.DeleteConterparty(new Guid("db5c88d7-391c-11dd-90d9-001a92567626"));
                Assert.Fail();
            }
            catch (ResponseException e)
            {
                Assert.AreEqual(e.Errors[0], "Counterparty not found");
            }
        }
Example #7
0
        public void CreateCounterPartyTest()
        {
            var cl     = new CounterPartyLogic(_jsonLogic);
            var result = cl.CreateConterparty(new CounterParty()
            {
                CityRef              = new Guid("db5c88d7-391c-11dd-90d9-001a92567626"),
                FirstName            = "Фелікс",
                MiddleName           = "Едуардович",
                LastName             = "Яковлєв",
                Phone                = "0997979789",
                Email                = "",
                CounterpartyType     = "PrivatePerson",
                CounterpartyProperty = "Recipient"
            });

            Assert.AreEqual(result.FirstName, "Фелікс");
        }