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()); }
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(); }