public void TryGetCommandTimeout_throws_if_bad_context_type_with_commandTimeout_is_registered_in_context_section() { var contextConfig = new ContextConfig( CreateEfSection("A.Bad.Context.Type", 66)); var exception = Assert.Throws <InvalidOperationException>(() => contextConfig.TryGetCommandTimeout(typeof(DbContext))); Assert.Equal( Strings.Database_InitializationException, exception.Message); Assert.IsType <TypeLoadException>(exception.InnerException); }
public void TryGetCommandTimeout_throws_if_bad_context_type_with_commandTimeout_is_registered_in_context_section() { var contextConfig = new ContextConfig( CreateEfSection("A.Bad.Context.Type", 66)); var exception = Assert.Throws<InvalidOperationException>(() => contextConfig.TryGetCommandTimeout(typeof(DbContext))); Assert.Equal( Strings.Database_InitializationException, exception.Message); Assert.IsType<TypeLoadException>(exception.InnerException); }