This project is read-only.

RhinoMocks and Stories

Mar 6, 2008 at 8:19 AM
Hi guys, this is a great project, I would like to see it grow and contribute if I ever have some time to. I tried it in a small application and would like to know if there's any integration between the story framework and the SpecBase class, where the AutoMockingCOntainer is used. In particular, I would like to create expectations while writing stories, and so far I have only been able to do it by "interrupting" the fluent interface to keep a reference to the story and the using explicitly RecordExpectedBehavior and PlaybackBehavior, as in the snippet below:

var story = new Story("Download and compare two files");
GivenFragment story2;

story.AsA("User").
IWant("to download the two files and compare them").
SoThat("I can resolve the conflict");

using (RecordExpectedBehavior)
story2 = story.WithScenario("The files are identical")
.Given("that the content of the first file is", "a", input => Expect.Call(Get<IFileDownloader>().Download(null)).IgnoreArguments().Return(input))
.And("the the content of the second file is", "a", input => Expect.Call(Get<IFileDownloader>().Download(null)).IgnoreArguments().Return(input));
using (PlaybackBehavior)
story2.When("the files are compared", () => result = helper.Process(new[] ccc))
.Then("the result should be", true, input => Assert.AreEqual(input, result0));

Again, I your approach to BDD a lot, much more than emulating it with usual test fixtures, but I'm missing some documentation a lot.
May 11, 2008 at 4:31 AM
Hey Simone,

Right now we don't have any coupling between the mocking framework and the scenarios.  It's definitely something we'll look at for the 0.5 release!

simone_b wrote:
Hi guys, this is a great project, I would like to see it grow and contribute if I ever have some time to. I tried it in a small application and would like to know if there's any integration between the story framework and the SpecBase class, where the AutoMockingCOntainer is used. In particular, I would like to create expectations while writing stories, and so far I have only been able to do it by "interrupting" the fluent interface to keep a reference to the story and the using explicitly RecordExpectedBehavior and PlaybackBehavior, as in the snippet below:

var story = new Story("Download and compare two files");
GivenFragment story2;

story.AsA("User").
IWant("to download the two files and compare them").
SoThat("I can resolve the conflict");

using (RecordExpectedBehavior)
story2 = story.WithScenario("The files are identical")
.Given("that the content of the first file is", "a", input => Expect.Call(Get<IFileDownloader>().Download(null)).IgnoreArguments().Return(input))
.And("the the content of the second file is", "a", input => Expect.Call(Get<IFileDownloader>().Download(null)).IgnoreArguments().Return(input));
using (PlaybackBehavior)
story2.When("the files are compared", () => result = helper.Process(new[] ccc))
.Then("the result should be", true, input => Assert.AreEqual(input, result0));

Again, I your approach to BDD a lot, much more than emulating it with usual test fixtures, but I'm missing some documentation a lot.



May 11, 2008 at 11:40 AM
Are you planning to review submitted patches or accept any contributions? If so, I'd be glad to do it - as I did already - otherwise please be more explicit in saying that you don't accept any contributions.
May 11, 2008 at 5:24 PM
Hey Simone,

We definitely accept patches, but just not through CodePlex.  We've written off CodePlex as a source control system :)

Would you mind re-submitting that patch, just with the SVN diff in a zip file in an email?  That'll be the easiest for us.   CodePlex patching is....interesting to say the least.

Thanks for the interest,

Jimmy
May 12, 2008 at 8:10 AM
Edited May 12, 2008 at 8:14 AM
Fine, it's already up on Google hosting, along with this other one that I had already submitted.

jbogard wrote:
Hey Simone,

We definitely accept patches, but just not through CodePlex.  We've written off CodePlex as a source control system :)

Would you mind re-submitting that patch, just with the SVN diff in a zip file in an email?  That'll be the easiest for us.   CodePlex patching is....interesting to say the least.

Thanks for the interest,

Jimmy