Your code is fine - you're just missing the actual usage of the expectation.
The following code should work:
MockObject mockReader = MockManager.MockObject(
typeof(SqlDataReader),
Constructor.NotMocked);
mockReader.ExpectGetAlways("HasRows", true);
mockReader.ExpectAndReturn("Read", true, 1);
mockReader.ExpectAndReturn("Read", false, 1);
SqlDataReader FakeSqlDataReader = mockReader.Object as sqlDataReader;
Assert.IsTrue(FakeSqlDataReader.HasRows);
Assert.IsTrue(FakeSqlDataReader.Read());
Assert.IsFalse(FakeSqlDataReader.Read());
MockManager.Verify();
As you can see after setting the expectation I can take a fake object by using
mockReader.Object and run the code using it
Note:
To define behavior for future objects (objects that don't exist yet) use MockManager.Mock - this way the next time you create a new object of that type using
new it will have the desired behavior.