コード例 #1
0
        public void Should_Run_Compilation_Test_For_Context()
        {
            //Arrange
            Database.SetInitializer(new DropCreateDatabaseAlways <TestDataContext>());
            var consoleOutLogger = new ConsoleOutLogger("Performance", LogLevel.All, true, true, true, "");
            var context          = new TestDataContext(Settings.Default.Connection, new FooMappingConfiguration(),
                                                       consoleOutLogger);

            //Act
            IEnumerable <Foo> result = null;

            try
            {
                var query = new FindFoo();
                context.RunStartUpPerformanceTest(query, consoleOutLogger, maxAllowableMilliseconds: -1);
            }
            catch (Exception e)
            {
                Assert.IsTrue(e.Message.Contains("Context Compilation in"));
            }


            //Assert
            Assert.IsNull(result);
        }