Hi,
It depends how your code is written here is a small example.
You should read the documentation about how to set up expectations:
(Taken from another post)
MockManager.Init();
// mock the next sqlConnection instance
m_MockConnection = MockManager.Mock(typeof(SqlConnection));
// expect a certain connection string (you can use Custom Parameter
// checkers to do a dynamic check)
m_MockConnection.ExpectConstructor().Args("your connection string");
// mock Open, you can mock throwing an exception by using
// ExpectAndThrow("Open",new SqlException())
m_MockConnection.ExpectCall("Open");
// Mock State and return Open
m_MockConnection.ExpectGet("State",ConnectionState.Open);
// Mock the next sqlCommand instance
MockObject mockCommand = MockManager.Mock(typeof(SqlCommand));
// Create the mocked instancem, you can add expectations
SqlCommand command = new SqlCommand();
// return it when Connection.CreateCommand is called
m_MockConnection.ExpectAndReturn("CreateCommand",command);