示例#1
0
        public void SessionImpl_Disposes_Connection_On_Dispose()
        {
            var fixture = new PersistenceAdapterFixture();
            var session = new SessionImpl(fixture.Connection);

            session.Dispose();

            fixture.ConnectionMock.Verify(c => c.Dispose());
        }
示例#2
0
        private static void Main()
        {
            var performance = new AdoNetPerformance();
            var database = new DatabaseImpl(ConnectionString);

            Console.WriteLine("Process: " + performance.InstanceName);
            Console.WriteLine();
            Console.WriteLine("Press any key to start ADO.NET performance test...");
            Console.ReadLine();

            var sw = new Stopwatch();
            sw.Start();

            for (int i = 0; i < 500; i++)
            {
                var session = new SessionImpl(database);
                var formTexts = session.FindAll<FormText>();
                session.Dispose();
                Console.Write(".");
            }
            sw.Stop();

            Console.WriteLine();
            Console.WriteLine(sw.ElapsedMilliseconds + " ms");

            performance.DisplayPerformanceCounters();
        }