arrange-act-assert

Xunit: Perform all 'Assert'ions in one test method?

Is it possible to tell xUnit.net to perform all e.g. Assert.True() in one test method? Basically in some of our use/testcases all assertions belong logically to one and the same 'scope' of tests and I have e.g. something like this: [Fact(DisplayName = "Tr-MissImpl")] public void MissingImplementationTest() { // parse...

Rhino Mocks AAA Quick Start?

Hi, I've been looking around for some decent information on using Rhino Mocks 3.5+ with the AAA syntax. I find a lot of blogs that have a mix of things from the old and new which seem to make it more difficult to figure out how to use it. Would would be great would be if there were a Rhino Mocks AAA Cheat Sheet like was done for an earl...

Rhino Mocks -- assert no interaction with mock/stub

Is it possible to tell that a mock/stub has seen no interaction at all in RhinoMocks. Something along the lines of: logger.AssertNoInteraction(); Which would assert no method has been called on the stubbed logger. This would be a much less tedious than calling the following each time: logger.AssertWasNotCalled(l => l.Debug(Arg<strin...

RhinoMocks AAA Syntax

Hi, I've spent a good part of the day trying to figure out why a simple RhinoMocks test doesn't return the value I'm setting in the return. I'm sure that I'm just missing something really simple but I can't figure it out. Here's my test: [TestMethod] public void CopyvRAFiles_ShouldCallCopyvRAFiles_ShouldReturnTrue2() { ...

How to use the AAA syntax to do an AssertWasCalled but ignore arguments

I'm using the new AAA syntax and wanted to know the syntax to do the below and have the mock ignore the agruments. mockAccount.AssertWasCalled(account => account.SetPassword("dsfdslkj")); I think the below is how I would do this with the record/ replay model but I wanted to see if this could be done with AAA using 3.6 mockAccount.Expe...

Is there value in unit testing auto implemented properties

It seems exceptionally heavy handed but going by the rule anything publicly available should be tested should auto-implemented properties be tested? Customer Class public class Customer { public string EmailAddr { get; set; } } Tested by [TestClass] public class CustomerTests : TestClassBase { [TestMethod] public void Ca...

Which style exists for mocking with Rhino?

I heard that latest style is AAA. Is there any other one? Why we use one and don't use another? ...

How to mock arbitrary behavior with Rhino Mocks?

Hi all, I'm trying to mock a data layer method. The method takes a string and two lists as arguments, and the method populates those lists from the results of a stored proc. Also, I'm still on C# 2.0 with VS2005, and I'm using Rhino Mocks 3.5 for .NET 2.0. If possible, it would be nice to use the AAA format. So yeah, all I want to do ...

Mixing Assert and Act in AAA unit testing syntax

Is it OK to mix Assert and Act steps? Is AAA more of a guideline than a rule? Or am I missing something? Here is my test: [TestMethod] public void CancelButtonSelected_DontCancelTwiceThenCancel_DialogCloses() { // Arrange IAddAddressForm form = Substitute.For<IAddAddressForm>(); // Indicate that when Show CancelMessage is...