Skip to content

Instantly share code, notes, and snippets.

@jfojtl
Created July 30, 2012 15:36
Show Gist options
  • Save jfojtl/3207874 to your computer and use it in GitHub Desktop.
Save jfojtl/3207874 to your computer and use it in GitHub Desktop.
This should pass, right? http://ayende.com/wiki/RecursiveMocksGuidance.ashx - but it fails
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Rhino.Mocks;
using Xunit;
namespace ClassLibrary1
{
public class RhinoMocksRecursiveMocking
{
[Fact]
public void RecursiveMocksTesting()
{
var complicatedSUT = MockRepository.GenerateStub<IFirstDep>();
Assert.Equal(complicatedSUT.SecondDep.Name, string.Empty);
}
}
public interface IFirstDep
{
ISecondDep SecondDep { get; set; }
}
public interface ISecondDep
{
string Name { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment