/// <summary> /// Check, that the correct interface type attribute has been placed. /// </summary> protected void CheckInterfaceAttr(Type testType, IdlTypeInterface expected) { object[] ifAttrs = testType.GetCustomAttributes(typeof(InterfaceTypeAttribute), false); Assert.AreEqual(1, ifAttrs.Length, "wrong number of InterfaceTypeAttribute"); InterfaceTypeAttribute ifAttr = (InterfaceTypeAttribute)ifAttrs[0]; Assert.AreEqual(expected, ifAttr.IdlType, "wrong ifattr"); }
private void CheckInterfaceDefinitions(string ifModifier, IdlTypeInterface ifAttrVal) { MemoryStream testSource = new MemoryStream(); StreamWriter writer = CreateSourceWriter(testSource); try { WriteIdlTestInterfaceToStream(writer, ifModifier); testSource.Seek(0, SeekOrigin.Begin); Assembly result = CreateIdl(testSource, GetAssemblyName()); // check if interface is correctly created Type ifType = result.GetType("testmod.Test", true); CheckPublicInstanceMethodPresent(ifType, "EchoOctet", typeof(System.Byte), new Type[] { typeof(System.Byte) }); CheckRepId(ifType, "IDL:testmod/Test:1.0"); CheckInterfaceAttr(ifType, ifAttrVal); CheckIIdlEntityInheritance(ifType); } finally { writer.Close(); } }
public InterfaceTypeAttribute(IdlTypeInterface idlType) { m_idlType = idlType; }