예제 #1
0
        public async Task GetMapBusStopsAsync_WithProductionConfiguration_MapBusStopListReturned()
        {
            // Arrange
            var configuration = _container.Resolve <IConfiguration>();
            var converter     = _container.Resolve <IJsonToObjectConverter>();
            var busLoader     = new BusStopLoader(configuration, converter);

            // Act
            var busStops = await busLoader.GetBusStopsAsync();

            // Assert
            busStops.Should().HaveCountGreaterThan(1);
        }
예제 #2
0
        public void Constructor_WhenArgsExist_CorrectUrlSaved()
        {
            // Arrange
            var configuration = _container.Resolve <IConfiguration>();

            // Act
            var busLoader = new BusStopLoader(configuration, null);

            // Assert
            busLoader.GetType()
            .GetFields(BindingFlags.NonPublic | BindingFlags.Instance)
            .First(p => p.Name == "_busStopListUrl")
            .GetValue(busLoader)
            .Should().Be(configuration.GetBusStopList);
        }
예제 #3
0
        public void Constructor_WhenArgsExist_ObjectCreated()
        {
            // Arrange
            var configuration = new Configuration {
                GetBusStopList = nameof(Configuration.GetBusStopList)
            };
            BusStopLoader busLoader = null;

            // Act
            Action action = () => busLoader = new BusStopLoader(configuration, null);

            // Assert
            action.Should().NotThrow <Exception>();
            busLoader.Should().NotBeNull();
        }