Skip to content

Commit

Permalink
Added report #85
Browse files Browse the repository at this point in the history
git-svn-id: http://moq.googlecode.com/svn/trunk@219 b33fba48-7441-0410-8d5c-f397f7ceaa6c
  • Loading branch information
kzu.net committed Jul 27, 2008
1 parent 78fe5ef commit ae628f9
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions UnitTests/Regressions/IssueReportsFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,53 @@ public void ReturnsIntPtr()
}


#endregion

#region #85

public class Issue85
{
[Fact]
public void FooTest()
{
// Setup
var fooMock = new Mock<Foo>();
fooMock.CallBase = true;
fooMock.Expect(o => o.GetBar()).Returns(new Bar());
var bar = ((IFoolery)fooMock.Object).DoStuffToBar();
Assert.NotNull(bar);
}

public interface IFoolery
{
Bar DoStuffToBar();
}

public class Foo : IFoolery
{
public virtual Bar GetBar()
{
return new Bar();
}

Bar IFoolery.DoStuffToBar()
{
return DoWeirdStuffToBar();
}

protected internal virtual Bar DoWeirdStuffToBar()
{
var bar = GetBar();
//Would do stuff here.
return bar;
}
}

public class Bar
{
}
}

#endregion

// run "netsh http add urlacl url=http://+:7777/ user=[domain]\[user]"
Expand Down

0 comments on commit ae628f9

Please sign in to comment.