public void TestDeepProfilingInterceptionStrategyWithNonInterfaceType() { var mockFilter = new Mock<IDeepProfilingFilter>(); var target = new DeepProfilingInterceptionStrategy(mockFilter.Object); var mockContext = new Mock<IBuilderContext>(); var testObj = new TestClass(); mockContext.Setup(c => c.Existing).Returns(testObj); mockContext.Setup(c => c.OriginalBuildKey).Returns(new NamedTypeBuildKey(typeof(TestClass))); var proxyCreated = false; mockContext.SetupSet(c => c.Existing = It.IsAny<object>()).Callback<object>(value => { proxyCreated = true; }); target.PostBuildUp(mockContext.Object); Assert.IsFalse(proxyCreated); }
public void TestDeepProfilingInterceptionStrategyWithEmptyContext() { var mockFilter = new Mock<IDeepProfilingFilter>(); var target = new DeepProfilingInterceptionStrategy(mockFilter.Object); target.PostBuildUp(null); }