コード例 #1
0
ファイル: MixinTestCase.cs プロジェクト: elevine/Core
		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)
			);
		}
コード例 #2
0
ファイル: MixinTestCase.cs プロジェクト: AllEmpty/Core
		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);
		}
コード例 #3
0
ファイル: MixinDataTestCase.cs プロジェクト: jeremymeng/Core
		public void TwoMixinsWithSameInterfaces()
		{
			SimpleMixin mixin1 = new SimpleMixin();
			OtherMixinImplementingISimpleMixin mixin2 = new OtherMixinImplementingISimpleMixin();

			Assert.Throws<ArgumentException>(() =>
				new MixinData(new object[] { mixin1, mixin2 })
			);
		}
コード例 #4
0
ファイル: MixinDataTestCase.cs プロジェクト: leloulight/Core
		public void TwoMixinsWithSameInterfaces()
		{
			SimpleMixin mixin1 = new SimpleMixin();
			OtherMixinImplementingISimpleMixin mixin2 = new OtherMixinImplementingISimpleMixin();

			new MixinData(new object[] { mixin1, mixin2 });
		}