Ejemplo n.º 1
0
        public async Task GetCities_ReturnsNoCitiesWhenNothingHasBeenFound()
        {
            IKinoheldClient client = new KinoheldClient();
            var             cities = await client.GetCities("999999");

            Assert.AreEqual(0, cities.Cities.Count);
            Assert.AreEqual(0, cities.PostalCodes.Count);
        }
Ejemplo n.º 2
0
        public async Task GetCities_ReturnsAurichWithAuric()
        {
            IKinoheldClient client = new KinoheldClient();
            var             cities = await client.GetCities("auric");

            Assert.AreEqual(1, cities.Cities.Count);
            Assert.AreEqual(0, cities.PostalCodes.Count);
            Assert.AreEqual("Aurich", cities.Cities[0].Name);
        }
        public async Task GetCities_ReturnEmptyResultWhenNoCitiesWereFound()
        {
            IKinoheldClient client = new KinoheldClient(m_kinoheldApiClientMock.Object, m_kinoheldJsonWorkerMock.Object);
            var             result = await client.GetCities("aurick");

            Assert.NotNull(result);
            Assert.AreEqual(0, result.Cities.Count);
            Assert.AreEqual(0, result.PostalCodes.Count);
        }
Ejemplo n.º 4
0
        public void GetCities_ThrowsOnCancel()
        {
            var cts = new CancellationTokenSource();

            cts.Cancel();

            IKinoheldClient client = new KinoheldClient();

            Assert.ThrowsAsync <TaskCanceledException>(async() =>
            {
                var o = await client.GetCities("aurich", cancellationToken: cts.Token);
            });
        }