Hi,
RhinoMocks supports AAA, but unfortunately rather in an Arrange-Assert-
Act way, that is not so easy to fit. If you don't have a strong
argument for Rhino, you can switch to Moq.
I had a post to Kevin's question about the mocking... Besides those
comments, I think it makes sense to cleanly separate between using
mocks and stubs in your tests. In functional testing, especially if
you isolate the database, you need to use stubs not mocks (so
basically you need to specify a stub database with some initial data
and finally verify, that the stub database contains the expected
result data). The same can stand for other things than the database,
like the file system. For stubs, you don't need to verify if this or
that action was called, so there is no need to call VerifyAll, also no
need to create strict mocks. I would automate your scenario in the
following way:
Scenario: The file has valid number of lineas
Given that there are 3000 records on the database -> create
a stub repo with 3000 record (same as you did)
And that the file valid_file.txt has 3000 lines -> create a
stub file with 3000 lines (same as you did)
When the file is parsed -> create parser, call parse (same as
you did, except replayall)
Then the file must be flagged as valid -> Assertion
(Assert.IsTrue(...)) on stub file or on the stub database, whether the
flas is true (i don't know fully what flagging means)
And the formatter process must be called -> Assertion on the
parser (like what you have in the last line)
PS: other comment: for communicating between steps in the same class,
i think it is more convenient to use member fields or a special
context class injected into your class than using the ScenarioContext.