// Arrange ... Given that I have a thing for executing
var expected = new Package { Id = 23 };
var thingUnderTest = new MyThingUnderTest();// Act ... When we invoke Execute passing in the id of a known registered package thingUnderTest.Execute(expected.Id); var actual = thingUnderTest.Package; // Assert ... Then Package should reference the registered Package Assert.AreEqual(expected, actual); So there's really no need for mocking even .... but perhaps you will be running against a real data store or something, in which case you need to mock your repository (as suggested by others) ... or maybe you might just change the following // Act thingUnderTest.Execute(23); // Assert Assert.AreEqual(23, actual.Id); On Jan 20, 5:21 pm, Laksh <[email protected]> wrote: > Well i was looking for actual example. I know what the test supposed > to do. But i don’t know syntactically how do write the test using > Rhino > -- You received this message because you are subscribed to the Google Groups "Rhino.Mocks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rhinomocks?hl=en.
