Beispiel #1
0
        public void Setup()
        {
            this.mocks = new MockRepository();
            this.mockConnection = this.mocks.StrictMock<Connection>();
            SetupResult.For(this.mockConnection.Database).Return("mock.edb");
            SetupResult.For(this.mockConnection.Name).Return("mock_instance");

            // Only the TestSqlImpl provides a method to set the connection
            var sqlImpl = new TestSqlImpl();
            sqlImpl.FTO_SetConnection(this.mockConnection);
            this.sqlImpl = sqlImpl;
        }
 public void SqlImplCreateDatabaseCallsConnectionFactory()
 {
     Expect.Call(this.mockConnectionManager.CreateDatabase("sqldatabase.edb", DatabaseCreationMode.None)).Return(this.dummyConnection);
     this.mocks.ReplayAll();
     var sqlimpl = new SqlImplBase();
     sqlimpl.CreateDatabase("sqldatabase.edb");
     this.mocks.VerifyAll();
 }
 public void SqlImplAttachDatabaseCallsConnectionFactory()
 {
     Expect.Call(this.mockConnectionManager.AttachDatabase("sqldatabase.edb", DatabaseOpenMode.ReadWrite)).Return(this.dummyConnection);
     this.mocks.ReplayAll();
     var sqlimpl = new SqlImplBase();
     sqlimpl.AttachDatabase("sqldatabase.edb");
     this.mocks.VerifyAll();
 }