예제 #1
0
		public void GetMixinInterfaceImplementationsAsArray()
		{
			MixinData mixinData = new MixinData(new object[] {simpleMixin});
			object[] mixinsAsArray = mixinData.GetMixinInterfaceImplementationsAsArray();
			Assert.AreEqual(1, mixinsAsArray.Length);
			Assert.AreSame(simpleMixin, mixinsAsArray[0]);
		}
예제 #2
0
		public void MixinsAreSortedByInterface()
		{
			MixinData mixinData1 = new MixinData(new object[] {simpleMixin, otherMixin});
			object[] mixinsAsArray1 = mixinData1.GetMixinInterfaceImplementationsAsArray();
			Assert.AreEqual(2, mixinsAsArray1.Length);
			Assert.AreSame(otherMixin, mixinsAsArray1[0]);
			Assert.AreSame(simpleMixin, mixinsAsArray1[1]);

			MixinData mixinData2 = new MixinData(new object[] {otherMixin, simpleMixin});
			object[] mixinsAsArray2 = mixinData2.GetMixinInterfaceImplementationsAsArray();
			Assert.AreEqual(2, mixinsAsArray2.Length);
			Assert.AreSame(otherMixin, mixinsAsArray2[0]);
			Assert.AreSame(simpleMixin, mixinsAsArray2[1]);
		}
예제 #3
0
		public void MixinsNotImplementingInterfacesAreIgnored()
		{
			MixinData mixinData = new MixinData(new object[] {new object()});
			object[] mixinsAsArray = mixinData.GetMixinInterfaceImplementationsAsArray();
			Assert.AreEqual(0, mixinsAsArray.Length);
		}