Пример #1
0
        public void GetCustomersAsync_PassNothing_ReturnObjects()
        {
            var client = new PodfatherClientV1(GetAPIKey());

            client.SetLogger(GetLogger());

            var results = Task.Run(async() => await client.GetCustomersAsync().ConfigureAwait(false)).Result;

            results.Count().Should().BeGreaterThan(0);
        }
Пример #2
0
        public void GetCustomersAsync_PassName_ReturnObjectsContaining()
        {
            var customerName = "A J WALTER LEASING LTD";
            var client       = new PodfatherClientV1(GetAPIKey());

            client.SetLogger(GetLogger());

            var results = Task.Run(async() => await client.GetCustomersAsync(0, customerName).ConfigureAwait(false)).Result;
            var result  = results.FirstOrDefault(e => e.Id == 727065);

            result.Id.Should().Be(727065);
            result.Address1.Should().Be("Exchange House");
            result.Address2.Should().Be("54-58 Athol Street");
            result.Address3.Should().Be("");
            result.AutoEmail.Should().Be(false);
            result.City.Should().Be("Douglas IM1 1JD");
            result.Country.Should().Be("GB");
            result.Email.Should().Be(null);
            result.Name.Should().Be("A J WALTER LEASING LTD");
            result.Phone.Should().Be(null);
            result.Postcode.Should().Be("");
            result.Region.Should().Be(null);
        }