Ejemplo n.º 1
0
            public void CallInterface()
            {
                IInterfaceWithGenericMethod interfaceInstance = (IInterfaceWithGenericMethod)this;

                interfaceInstance.InterfaceRequiresPublicFields <TOuter> ();
                interfaceInstance.InterfaceRequiresPublicMethods <TOuter> ();
            }
 public InterfaceWithGenericMethodAopProxy(
     IInterfaceWithGenericMethod realInstance,
     InterceptionHandler interceptionHandler)
 {
     _realInstance        = realInstance;
     _interceptionHandler = interceptionHandler;
 }
Ejemplo n.º 3
0
        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>());
        }
Ejemplo n.º 5
0
        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>());
        }
Ejemplo n.º 6
0
        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>());
        }
Ejemplo n.º 7
0
 public ClassWitIInterfaceWithGenericMethodParam(IInterfaceWithGenericMethod ctorParam)
 {
     CtorParam = ctorParam;
 }