Beispiel #1
0
        public async Task ReturnALocation(int Id)
        {
            var locationService = new HttpLocationService(_config);
            var result          = await locationService.GetLocationByIdAsync(Id);

            Assert.IsNotNull(result);
            Assert.That(result.Id, Is.EqualTo(Id));

            TestContext.WriteLine($" {result.Id} - {result.Name} - {result.State}");
        }
Beispiel #2
0
        public async Task ReturnLocations()
        {
            var locationService = new HttpLocationService(_config);
            var result          = await locationService.GetLocationsAsync();

            Assert.That(result, Is.Not.Null);
            Assert.IsInstanceOf <IEnumerable <Location> >(result);
            Assert.That(result.Count(), Is.GreaterThan(0));

            var firstLocation = result.FirstOrDefault();

            Assert.IsNotNull(firstLocation);
            Assert.IsInstanceOf <Location>(firstLocation);

            TestContext.WriteLine($"First {firstLocation.Id} - {firstLocation.Name} - {firstLocation.State}");
        }
Beispiel #3
0
        public void Exists()
        {
            var locationService = new HttpLocationService(_config);

            Assert.IsInstanceOf <HttpLocationService>(locationService);
        }