Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }