public void GetFastInvoker() { var objToReturn = (Func <string>)(() => "Test"); _declarationMethodInformationStub.Stub(stub => stub.GetFastInvoker(typeof(Func <string>))).Return(objToReturn); var invoker = _interfaceImplementationMethodInformation.GetFastInvoker <Func <string> >(); Assert.That(invoker, Is.SameAs(objToReturn)); }
public void FindInterfaceDeclaration() { IMethodInformation methodInformation = MethodInfoAdapter.Create(typeof(object).GetMethod("ToString")); _declarationMethodInformationStub .Stub(stub => stub.FindInterfaceDeclarations()) .Return(EnumerableUtility.Singleton(methodInformation).AsOneTime()); Assert.That(_mixinIntroducedMethodInformation.FindInterfaceDeclarations(), Is.EqualTo(new[] { _declarationMethodInformationStub })); Assert.That(_mixinIntroducedMethodInformation.FindInterfaceDeclarations(), Is.EqualTo(new[] { _declarationMethodInformationStub })); }
public void Name() { _implementationMethodInformationStub.Stub(stub => stub.Name).Return("Test"); Assert.That(_interfaceImplementationMethodInformation.Name, Is.EqualTo("Test")); }
public void Name() { _implementationMethodInformationStub.Stub(stub => stub.Name).Return("Test"); Assert.That(_mixinIntroducedMethodInformation.Name, Is.EqualTo("Test")); }