From ae628f9d33ba27449bf57c0e7f450c5f5df27f27 Mon Sep 17 00:00:00 2001 From: "kzu.net" Date: Sun, 27 Jul 2008 00:33:16 +0000 Subject: [PATCH] Added report #85 git-svn-id: http://moq.googlecode.com/svn/trunk@219 b33fba48-7441-0410-8d5c-f397f7ceaa6c --- UnitTests/Regressions/IssueReportsFixture.cs | 47 ++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/UnitTests/Regressions/IssueReportsFixture.cs b/UnitTests/Regressions/IssueReportsFixture.cs index e028feff0..fb3ebd828 100644 --- a/UnitTests/Regressions/IssueReportsFixture.cs +++ b/UnitTests/Regressions/IssueReportsFixture.cs @@ -202,6 +202,53 @@ public void ReturnsIntPtr() } + #endregion + + #region #85 + + public class Issue85 + { + [Fact] + public void FooTest() + { + // Setup + var fooMock = new Mock(); + 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]"