Esempio n. 1
0
        public async Task ConfigurationProvider_GetAppSettingValue_WhenConfigurationFileDoesNotExist_ShouldThrow()
        {
            // Arrange
            var testConfigurationProvider = new ConfigurationProviderLyft("thisFileNameDoesNotExist");
            var testKey = "thisKeyDoesNotExist";

            // Act
            try
            {
                await testConfigurationProvider.GetAppSettingValue(testKey);

                Assert.Fail("Expected a GetARideServiceMissingConfigurationFileException but no exception was thrown.");
            }
            catch (GetARideServiceMissingConfigurationFileException ex)
            {
                // Assert
                AssertEx.AssertExceptionMessageContains(new List <string>()
                {
                    "cannot find", "configuration file"
                }, ex);
            }
            catch (Exception ex)
            {
                Assert.Fail("Expected a GetARideServiceMissingConfigurationFileException to be thrown, but a different " +
                            "exception was thrown: " + ex.GetType() + " - " + ex.Message);
            }
        }
Esempio n. 2
0
        public async Task ConfigurationProvider_GetAppSettingValue_WhenConfigurationFileExistsAndSettingExists_ShouldReturnSetting()
        {
            // Arrange
            var testConfigurationProvider = new ConfigurationProviderLyft("appsettingsfortest.json");
            var testKey = "testKey";

            // Act
            var testValue = await testConfigurationProvider.GetAppSettingValue(testKey);

            // Assert
            Assert.AreEqual("testingValue", testValue);
        }
Esempio n. 3
0
 public RideSharingLyft(IHttpMessageHandlerFactory httpMessageHandlerFactory, ConfigurationProviderLyft configurationProvider, LyftToGetARyderTransformer lyftToGetARyderTransformer)
     : base(httpMessageHandlerFactory)
 {
     this._lyftGatewayConfiguration   = configurationProvider.GetGatewayConfiguration();
     this._lyftToGetARydertransformer = lyftToGetARyderTransformer;
 }