public void Ctor_MajorVersion_MinorVersion(int major, int minor) { var attribute = new PrimaryInteropAssemblyAttribute(major, minor); Assert.Equal(major, attribute.MajorVersion); Assert.Equal(minor, attribute.MinorVersion); }
public void Exists() { Type type = typeof(PrimaryInteropAssemblyAttributeTests); Assembly assembly = type.GetTypeInfo().Assembly; PrimaryInteropAssemblyAttribute attribute = Assert.Single(assembly.GetCustomAttributes <PrimaryInteropAssemblyAttribute>()); Assert.Equal(1, attribute.MajorVersion); Assert.Equal(2, attribute.MinorVersion); }
private static void AddPrimaryInteropAssemblyToRegFile(String strAsmGuid, String strAsmName, String strAsmCodeBase, PrimaryInteropAssemblyAttribute attr, Stream regFile) { String strTlbId = "{" + strAsmGuid + "}"; String strVersion = attr.MajorVersion + "." + attr.MinorVersion; WriteUTFChars(regFile, Environment.NewLine); WriteUTFChars(regFile, "[" + strClassesRootRegKey + "\\TypeLib\\" + strTlbId + "\\" + strVersion + "]" + Environment.NewLine); WriteUTFChars(regFile, "\"PrimaryInteropAssemblyName\"=\"" + strAsmName + "\"" + Environment.NewLine); if (strAsmCodeBase != null) { WriteUTFChars(regFile, "\"PrimaryInteropAssemblyCodeBase\"=\"" + strAsmCodeBase + "\"" + Environment.NewLine); } }