예제 #1
0
        public void Constructed_select_query_honors_latest_configured_CommandTimeout_configured_in_context()
        {
            using (var context = new ConfiguredChipsContext(_fixture.ServiceProvider))
            {
                var commandBuilder = SetupCommandBuilder();

                context.Database.SetCommandTimeout(88);
                var command = commandBuilder.Build(context.GetService <IRelationalConnection>(), new Dictionary <string, object>());

                Assert.Equal(88, command.CommandTimeout);

                context.Database.SetCommandTimeout(99);
                var command2 = commandBuilder.Build(context.GetService <IRelationalConnection>(), new Dictionary <string, object>());

                Assert.Equal(99, command2.CommandTimeout);
            }
        }
예제 #2
0
        public void Constructed_select_query_CommandBuilder_uses_default_when_null()
        {
            using (var context = new ConfiguredChipsContext(_fixture.ServiceProvider))
            {
                var commandBuilder = SetupCommandBuilder();

                context.Database.SetCommandTimeout(null);
                var command = commandBuilder.Build(context.GetService <IRelationalConnection>(), new Dictionary <string, object>());

                Assert.Equal(new SqliteCommand().CommandTimeout, command.CommandTimeout);
            }
        }