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); }
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); }
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(); }