public void CallInterface() { IInterfaceWithGenericMethod interfaceInstance = (IInterfaceWithGenericMethod)this; interfaceInstance.InterfaceRequiresPublicFields <TOuter> (); interfaceInstance.InterfaceRequiresPublicMethods <TOuter> (); }
public InterfaceWithGenericMethodAopProxy( IInterfaceWithGenericMethod realInstance, InterceptionHandler interceptionHandler) { _realInstance = realInstance; _interceptionHandler = interceptionHandler; }
static void TestMethodGenericParametersViaInheritance() { TypeWithInstantiatedGenericMethodViaGenericParameter <TestType> .StaticRequiresPublicFields <TestType> (); TypeWithInstantiatedGenericMethodViaGenericParameter <TestType> .StaticRequiresPublicFieldsNonGeneric(); TypeWithInstantiatedGenericMethodViaGenericParameter <TestType> .StaticPartialInstantiation(); TypeWithInstantiatedGenericMethodViaGenericParameter <TestType> .StaticPartialInstantiationUnrecognized(); var instance = new TypeWithInstantiatedGenericMethodViaGenericParameter <TestType> (); instance.InstanceRequiresPublicFields <TestType> (); instance.InstanceRequiresPublicFieldsNonGeneric(); instance.VirtualRequiresPublicFields <TestType> (); instance.VirtualRequiresPublicMethods <TestType> (); instance.CallInterface(); IInterfaceWithGenericMethod interfaceInstance = (IInterfaceWithGenericMethod)instance; interfaceInstance.InterfaceRequiresPublicFields <TestType> (); interfaceInstance.InterfaceRequiresPublicMethods <TestType> (); }
public void GenericMethodsAreIgnored() { // Arrange var fixture = new Fixture().Customize(new AutoConfiguredMoqCustomization()); var frozenString = fixture.Freeze <string>(); // Act & Assert IInterfaceWithGenericMethod result = null; Assert.Null(Record.Exception(() => result = fixture.Create <IInterfaceWithGenericMethod>())); Assert.NotEqual(frozenString, result.GenericMethod <string>()); }
public void GenericMethodsAreIgnored() { // Fixture setup var fixture = new Fixture().Customize(new AutoConfiguredMoqCustomization()); var frozenString = fixture.Freeze <string>(); // Exercise system and verify outcome IInterfaceWithGenericMethod result = null; Assert.DoesNotThrow(() => result = fixture.Create <IInterfaceWithGenericMethod>()); Assert.NotEqual(frozenString, result.GenericMethod <string>()); }
public void WithConfigureMembers_GenericReturnValuesFromFixture() { // Arrange var fixture = new Fixture().Customize(new AutoMoqCustomization()); var frozenString = fixture.Freeze <string>(); // Act & Assert IInterfaceWithGenericMethod result = null; result = fixture.Create <IInterfaceWithGenericMethod>(); Assert.Equal(frozenString, result.GenericMethod <string>()); }
public ClassWitIInterfaceWithGenericMethodParam(IInterfaceWithGenericMethod ctorParam) { CtorParam = ctorParam; }