Ejemplo n.º 1
0
        public void TwoMixinsWithSameInterfaces()
        {
            SimpleMixin mixin1 = new SimpleMixin();
            OtherMixinImplementingISimpleMixin mixin2 = new OtherMixinImplementingISimpleMixin();

            new MixinData(new object[] { mixin1, mixin2 });
        }
Ejemplo n.º 2
0
        public void TwoMixinsWithSameInterfaces()
        {
            SimpleMixin mixin1 = new SimpleMixin();
            OtherMixinImplementingISimpleMixin mixin2 = new OtherMixinImplementingISimpleMixin();

            Assert.Throws <ArgumentException>(() => new MixinData(new object[] { mixin1, mixin2 }));
        }
Ejemplo n.º 3
0
        public void TwoMixinsWithSameInterface()
        {
            ProxyGenerationOptions             options = new ProxyGenerationOptions();
            SimpleMixin                        mixin1  = new SimpleMixin();
            OtherMixinImplementingISimpleMixin mixin2  = new OtherMixinImplementingISimpleMixin();

            options.AddMixinInstance(mixin1);
            options.AddMixinInstance(mixin2);

            StandardInterceptor interceptor = new StandardInterceptor();

            generator.CreateClassProxy(typeof(SimpleClass), options, interceptor);
        }
Ejemplo n.º 4
0
        public void TwoMixinsWithSameInterface()
        {
            ProxyGenerationOptions             options = new ProxyGenerationOptions();
            SimpleMixin                        mixin1  = new SimpleMixin();
            OtherMixinImplementingISimpleMixin mixin2  = new OtherMixinImplementingISimpleMixin();

            options.AddMixinInstance(mixin1);
            options.AddMixinInstance(mixin2);

            StandardInterceptor interceptor = new StandardInterceptor();

            Assert.Throws <InvalidMixinConfigurationException>(() =>
                                                               generator.CreateClassProxy(typeof(SimpleClass), options, interceptor)
                                                               );
        }