Пример #1
0
 public void ShouldConnectThroughTcpProxy()
 {
     using (var tcpProxy = new TcpProxy(12424))
         using (var context = new TestDatabaseContextProxy(tcpProxy.Forwarding))
             using (var database = new ODatabase(TestConnectionProxy.GlobalTestDatabaseAlias))
             {
                 SimpleTest(database);
             }
 }
 public void ShouldConnectThroughTcpProxy()
 {
     using (var tcpProxy = new TcpProxy(12424))
     using (var context = new TestDatabaseContextProxy(tcpProxy.Forwarding))
     using (var database = new ODatabase(TestConnectionProxy.GlobalTestDatabaseAlias))
     {
         SimpleTest(database);
     }
 }
Пример #3
0
        public void ShouldReconnectIfTcpProxyIsRestored()
        {
            using (var tcpProxy = new TcpProxy(12424))
                using (var context = new TestDatabaseContextProxy(tcpProxy.Forwarding))
                    using (var database = new ODatabase(TestConnectionProxy.GlobalTestDatabaseAlias))
                    {
                        tcpProxy.End();
                        tcpProxy.Start();

                        try
                        {
                            SimpleTest(database);
                            Assert.True(false, "SimpleTest should of failed without a socket connection");
                        }
                        catch
                        {
                            SimpleTest(database);
                        }
                    }
        }
        public void ShouldReconnectIfTcpProxyIsRestored()
        {
            using (var tcpProxy = new TcpProxy(12424))
            using (var context = new TestDatabaseContextProxy(tcpProxy.Forwarding))
            using (var database = new ODatabase(TestConnectionProxy.GlobalTestDatabaseAlias))
            {
                tcpProxy.End();
                tcpProxy.Start();

                try
                {
                    SimpleTest(database);
                    Assert.Fail("SimpleTest should of failed without a socket connection");
                }
                catch
                {
                    SimpleTest(database);
                }
            }
        }