}
[Test]
- [Category ("NotWorking")]
public void GetVersionInfo_TextFile ()
{
string file = Path.Combine (tempDir, "lib.dll");
}
[Test]
- [Category ("NotWorking")]
public void GetVersionInfo_NoNativeResources ()
{
AssemblyName aname = new AssemblyName ();
new CustomAttributeBuilder (ci, new object [1] { "Mono Team" });
ab.SetCustomAttribute (cab);
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "System Test" });
+ ab.SetCustomAttribute (cab);
+
// ProductName
attrType = typeof (AssemblyProductAttribute);
ci = attrType.GetConstructor (new Type [] { typeof (String) });
}
[Test] // DefineUnmanagedResource (String)
- [Category ("NotWorking")]
public void DefineUnmanagedResource1a ()
{
string resFile = Path.Combine (tempDir, "version.res");
}
[Test] // DefineUnmanagedResource (String)
- [Category ("NotWorking")]
public void DefineUnmanagedResource1b ()
{
string resFile = Path.Combine (tempDir, "version.res");
new CustomAttributeBuilder (ci, new object [1] { "Mono Team" });
ab.SetCustomAttribute (cab);
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "System Test" });
+ ab.SetCustomAttribute (cab);
+
// ProductName
attrType = typeof (AssemblyProductAttribute);
ci = attrType.GetConstructor (new Type [] { typeof (String) });
}
[Test] // DefineUnmanagedResource (String)
- [Category ("NotWorking")]
+ [Category ("NotWorking")] // bug #374600
public void DefineUnmanagedResource1c ()
{
string resFile = Path.Combine (tempDir, "version.res");
}
[Test] // DefineUnmanagedResource (String)
- [Category ("NotWorking")]
+ [Category ("NotWorking")] // bug #374600
public void DefineUnmanagedResource1d ()
{
string resFile = Path.Combine (tempDir, "version.res");
new CustomAttributeBuilder (ci, new object [1] { "Mono Team" });
ab.SetCustomAttribute (cab);
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "System Test" });
+ ab.SetCustomAttribute (cab);
+
// ProductName
attrType = typeof (AssemblyProductAttribute);
ci = attrType.GetConstructor (new Type [] { typeof (String) });
}
[Test] // DefineUnmanagedResource (String)
- [Category ("NotWorking")]
+ [Category ("NotWorking")] // bug #374600
public void DefineUnmanagedResource1e ()
{
string resFile = Path.Combine (tempDir, "version.res");
}
[Test] // DefineUnmanagedResource (String)
- [Category ("NotWorking")]
+ [Category ("NotWorking")] // bug #374600
public void DefineUnmanagedResource1f ()
{
string resFile = Path.Combine (tempDir, "version.res");
new CustomAttributeBuilder (ci, new object [1] { "Mono Team" });
ab.SetCustomAttribute (cab);
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "System Test" });
+ ab.SetCustomAttribute (cab);
+
// ProductName
attrType = typeof (AssemblyProductAttribute);
ci = attrType.GetConstructor (new Type [] { typeof (String) });
}
[Test] // DefineUnmanagedResource (String)
- [Category ("NotWorking")]
public void DefineUnmanagedResource1g ()
{
string resFile = Path.Combine (tempDir, "version.res");
}
[Test] // DefineUnmanagedResource (String)
- [Category ("NotWorking")]
public void DefineUnmanagedResource1h ()
{
string resFile = Path.Combine (tempDir, "version.res");
new CustomAttributeBuilder (ci, new object [1] { "Mono Team" });
ab.SetCustomAttribute (cab);
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "System Test" });
+ ab.SetCustomAttribute (cab);
+
// ProductName
attrType = typeof (AssemblyProductAttribute);
ci = attrType.GetConstructor (new Type [] { typeof (String) });
}
[Test] // DefineVersionInfoResource (String, String, String, String, String)
- [Category ("NotWorking")]
public void DefineVersionInfoResource1a ()
{
AssemblyName aname = new AssemblyName ();
}
[Test] // DefineVersionInfoResource (String, String, String, String, String)
- [Category ("NotWorking")]
public void DefineVersionInfoResource1b ()
{
AssemblyName aname = new AssemblyName ();
}
[Test] // DefineVersionInfoResource (String, String, String, String, String)
- [Category ("NotWorking")]
public void DefineVersionInfoResource1c ()
{
AssemblyName aname = new AssemblyName ();
new CustomAttributeBuilder (ci, new object [1] { "Mono Team" });
ab.SetCustomAttribute (cab);
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "System Test" });
+ ab.SetCustomAttribute (cab);
+
// ProductName
attrType = typeof (AssemblyProductAttribute);
ci = attrType.GetConstructor (new Type [] { typeof (String) });
string assemblyFile = Path.Combine (tempDir, "lib1c.dll");
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
- Assert.AreEqual (" ", fvi.Comments, "#1");
+ Assert.AreEqual ("System Test", fvi.Comments, "#1");
Assert.AreEqual ("BBB", fvi.CompanyName, "#2");
Assert.AreEqual (0, fvi.FileBuildPart, "#3");
Assert.AreEqual (" ", fvi.FileDescription, "#4");
}
[Test] // DefineVersionInfoResource (String, String, String, String, String)
- [Category ("NotWorking")]
public void DefineVersionInfoResource1d ()
{
AssemblyName aname = new AssemblyName ();
new CustomAttributeBuilder (ci, new object [1] { "Mono Team" });
ab.SetCustomAttribute (cab);
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "System Test" });
+ ab.SetCustomAttribute (cab);
+
// ProductName
attrType = typeof (AssemblyProductAttribute);
ci = attrType.GetConstructor (new Type [] { typeof (String) });
string assemblyFile = Path.Combine (tempDir, "lib1d.dll");
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
- Assert.AreEqual (" ", fvi.Comments, "#1");
+ Assert.AreEqual ("System Test", fvi.Comments, "#1");
Assert.AreEqual (" ", fvi.CompanyName, "#2");
Assert.AreEqual (0, fvi.FileBuildPart, "#3");
Assert.AreEqual (" ", fvi.FileDescription, "#4");
}
[Test] // DefineVersionInfoResource (String, String, String, String, String)
- [Category ("NotWorking")]
public void DefineVersionInfoResource1e ()
{
AssemblyName aname = new AssemblyName ();
aname.CultureInfo = new CultureInfo ("nl-BE");
- aname.Name = "lib1a";
+ aname.Name = "lib1e";
aname.Version = new Version (5, 4, 7, 8);
AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
aname, AssemblyBuilderAccess.RunAndSave,
tempDir);
ab.DefineVersionInfoResource ("BBB", "1.3.2.4", "CCC", "DDD", "EEE");
- ab.Save ("lib1a.dll");
+ ab.Save ("lib1e.dll");
- string assemblyFile = Path.Combine (tempDir, "lib1a.dll");
+ string assemblyFile = Path.Combine (tempDir, "lib1e.dll");
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
Assert.AreEqual (" ", fvi.Comments, "#1");
Assert.AreEqual (assemblyFile, fvi.FileName, "#7");
Assert.AreEqual (8, fvi.FilePrivatePart, "#8");
Assert.AreEqual ("5.4.7.8", fvi.FileVersion, "#9");
- Assert.AreEqual ("lib1a", fvi.InternalName, "#10");
+ Assert.AreEqual ("lib1e", fvi.InternalName, "#10");
Assert.IsFalse (fvi.IsDebug, "#11");
Assert.IsFalse (fvi.IsPatched, "#12");
Assert.IsFalse (fvi.IsPreRelease, "#13");
Assert.AreEqual ("Dutch (Belgium)", fvi.Language, "#16");
Assert.AreEqual ("DDD", fvi.LegalCopyright, "#17");
Assert.AreEqual ("EEE", fvi.LegalTrademarks, "#18");
- Assert.AreEqual ("lib1a.dll", fvi.OriginalFilename, "#19");
+ Assert.AreEqual ("lib1e.dll", fvi.OriginalFilename, "#19");
Assert.AreEqual (string.Empty, fvi.PrivateBuild, "#20");
Assert.AreEqual (2, fvi.ProductBuildPart, "#21");
Assert.AreEqual (1, fvi.ProductMajorPart, "#22");
}
[Test] // DefineVersionInfoResource (String, String, String, String, String)
- [Category ("NotWorking")]
public void DefineVersionInfoResource1f ()
{
AssemblyName aname = new AssemblyName ();
aname.CultureInfo = new CultureInfo ("nl");
- aname.Name = "lib1a";
+ aname.Name = "lib1f";
aname.Version = new Version (5, 4, 7, 8);
AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
aname, AssemblyBuilderAccess.RunAndSave,
tempDir);
ab.DefineVersionInfoResource (null, null, null, null, null);
- ab.Save ("lib1a.dll");
+ ab.Save ("lib1f.dll");
- string assemblyFile = Path.Combine (tempDir, "lib1a.dll");
+ string assemblyFile = Path.Combine (tempDir, "lib1f.dll");
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
Assert.AreEqual (" ", fvi.Comments, "#1");
Assert.AreEqual (assemblyFile, fvi.FileName, "#7");
Assert.AreEqual (8, fvi.FilePrivatePart, "#8");
Assert.AreEqual ("5.4.7.8", fvi.FileVersion, "#9");
- Assert.AreEqual ("lib1a", fvi.InternalName, "#10");
+ Assert.AreEqual ("lib1f", fvi.InternalName, "#10");
Assert.IsFalse (fvi.IsDebug, "#11");
Assert.IsFalse (fvi.IsPatched, "#12");
Assert.IsFalse (fvi.IsPreRelease, "#13");
Assert.AreEqual ("Dutch (Netherlands)", fvi.Language, "#16");
Assert.AreEqual (" ", fvi.LegalCopyright, "#17");
Assert.AreEqual (" ", fvi.LegalTrademarks, "#18");
- Assert.AreEqual ("lib1a.dll", fvi.OriginalFilename, "#19");
+ Assert.AreEqual ("lib1f.dll", fvi.OriginalFilename, "#19");
Assert.AreEqual (string.Empty, fvi.PrivateBuild, "#20");
Assert.AreEqual (0, fvi.ProductBuildPart, "#21");
Assert.AreEqual (0, fvi.ProductMajorPart, "#22");
}
[Test] // DefineVersionInfoResource (String, String, String, String, String)
- [Category ("NotWorking")]
public void DefineVersionInfoResource1g ()
{
AssemblyName aname = new AssemblyName ();
new CustomAttributeBuilder (ci, new object [1] { "Mono Team" });
ab.SetCustomAttribute (cab);
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "System Test" });
+ ab.SetCustomAttribute (cab);
+
// ProductName
attrType = typeof (AssemblyProductAttribute);
ci = attrType.GetConstructor (new Type [] { typeof (String) });
string assemblyFile = Path.Combine (tempDir, "lib1g.dll");
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
- Assert.AreEqual (" ", fvi.Comments, "#1");
+ Assert.AreEqual ("System Test", fvi.Comments, "#1");
Assert.AreEqual ("BBB", fvi.CompanyName, "#2");
Assert.AreEqual (7, fvi.FileBuildPart, "#3");
Assert.AreEqual (" ", fvi.FileDescription, "#4");
}
[Test] // DefineVersionInfoResource (String, String, String, String, String)
- [Category ("NotWorking")]
public void DefineVersionInfoResource1h ()
{
AssemblyName aname = new AssemblyName ();
new CustomAttributeBuilder (ci, new object [1] { "Mono Team" });
ab.SetCustomAttribute (cab);
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "System Test" });
+ ab.SetCustomAttribute (cab);
+
// ProductName
attrType = typeof (AssemblyProductAttribute);
ci = attrType.GetConstructor (new Type [] { typeof (String) });
string assemblyFile = Path.Combine (tempDir, "lib1h.dll");
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
- Assert.AreEqual (" ", fvi.Comments, "#1");
+ Assert.AreEqual ("System Test", fvi.Comments, "#1");
Assert.AreEqual (" ", fvi.CompanyName, "#2");
#if NET_2_0
Assert.AreEqual (0, fvi.FileBuildPart, "#3");
}
[Test] // DefineVersionInfoResource (String, String, String, String, String)
- [Category ("NotWorking")]
public void DefineVersionInfoResource1i ()
{
AssemblyName aname = new AssemblyName ();
new CustomAttributeBuilder (ci, new object [1] { "Mono Team" });
ab.SetCustomAttribute (cab);
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "System Test" });
+ ab.SetCustomAttribute (cab);
+
// ProductName
attrType = typeof (AssemblyProductAttribute);
ci = attrType.GetConstructor (new Type [] { typeof (String) });
cab = new CustomAttributeBuilder (ci, new object [1] { "6.4.7.1" });
ab.SetCustomAttribute (cab);
- ab.DefineVersionInfoResource ("AAA", "", "BBB", "CCC", "DDD");
+ ab.DefineVersionInfoResource ("AAA", string.Empty,
+ "BBB", "CCC", "DDD");
ab.Save ("lib1i.dll");
string assemblyFile = Path.Combine (tempDir, "lib1i.dll");
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
- Assert.AreEqual (" ", fvi.Comments, "#1");
+ Assert.AreEqual ("System Test", fvi.Comments, "#1");
Assert.AreEqual ("BBB", fvi.CompanyName, "#2");
Assert.AreEqual (8, fvi.FileBuildPart, "#3");
Assert.AreEqual (" ", fvi.FileDescription, "#4");
Assert.AreEqual (string.Empty, fvi.SpecialBuild, "#27");
}
- [Test] // DefineVersionInfoResource ()
- [Category ("NotWorking")]
- public void DefineVersionInfoResource2a ()
- {
- AssemblyName aname = new AssemblyName ();
- aname.Name = "lib2a";
-
- AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
- aname, AssemblyBuilderAccess.RunAndSave,
- tempDir);
- ab.DefineVersionInfoResource ();
- ab.Save ("lib2a.dll");
-
- string assemblyFile = Path.Combine (tempDir, "lib2a.dll");
-
- FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
- Assert.AreEqual (" ", fvi.Comments, "#1");
- Assert.AreEqual (" ", fvi.CompanyName, "#2");
- Assert.AreEqual (0, fvi.FileBuildPart, "#3");
- Assert.AreEqual (" ", fvi.FileDescription, "#4");
- Assert.AreEqual (0, fvi.FileMajorPart, "#5");
- Assert.AreEqual (0, fvi.FileMinorPart, "#6");
- Assert.AreEqual (assemblyFile, fvi.FileName, "#7");
- Assert.AreEqual (0, fvi.FilePrivatePart, "#8");
- Assert.AreEqual ("0.0.0.0", fvi.FileVersion, "#9");
- Assert.AreEqual ("lib2a", fvi.InternalName, "#10");
- Assert.IsFalse (fvi.IsDebug, "#11");
- Assert.IsFalse (fvi.IsPatched, "#12");
- Assert.IsFalse (fvi.IsPreRelease, "#13");
- Assert.IsFalse (fvi.IsPrivateBuild, "#14");
- Assert.IsFalse (fvi.IsSpecialBuild, "#15");
- Assert.AreEqual ("Invariant Language (Invariant Country)", fvi.Language, "#16");
- Assert.AreEqual (" ", fvi.LegalCopyright, "#17");
- Assert.AreEqual (" ", fvi.LegalTrademarks, "#18");
- Assert.AreEqual ("lib2a.dll", fvi.OriginalFilename, "#19");
- Assert.AreEqual (string.Empty, fvi.PrivateBuild, "#20");
- Assert.AreEqual (0, fvi.ProductBuildPart, "#21");
- Assert.AreEqual (0, fvi.ProductMajorPart, "#22");
- Assert.AreEqual (0, fvi.ProductMinorPart, "#23");
- Assert.AreEqual (" ", fvi.ProductName, "#24");
- Assert.AreEqual (0, fvi.ProductPrivatePart, "#25");
- Assert.AreEqual (" ", fvi.ProductVersion, "#26");
- Assert.AreEqual (string.Empty, fvi.SpecialBuild, "#27");
- }
-
- [Test] // DefineVersionInfoResource ()
- [Category ("NotWorking")]
- public void DefineVersionInfoResource2b ()
+ [Test] // DefineVersionInfoResource (String, String, String, String, String)
+ public void DefineVersionInfoResource1j ()
{
AssemblyName aname = new AssemblyName ();
- aname.Name = "lib2b";
- aname.Version = new Version (3, 5, 7, 9);
+ aname.Name = "lib1j";
+ aname.Version = new Version (5, 4, 8, 2);
AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
aname, AssemblyBuilderAccess.RunAndSave,
new CustomAttributeBuilder (ci, new object [1] { "Mono Team" });
ab.SetCustomAttribute (cab);
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "System Test" });
+ ab.SetCustomAttribute (cab);
+
// ProductName
attrType = typeof (AssemblyProductAttribute);
ci = attrType.GetConstructor (new Type [] { typeof (String) });
cab = new CustomAttributeBuilder (ci, new object [1] { "6.4.7.1" });
ab.SetCustomAttribute (cab);
- // AssemblyCulture
- attrType = typeof (AssemblyCultureAttribute);
- ci = attrType.GetConstructor (new Type [] { typeof (String) });
- cab = new CustomAttributeBuilder (ci, new object [1] { "en-GB" });
- ab.SetCustomAttribute (cab);
-
- ab.DefineVersionInfoResource ();
- ab.Save ("lib2b.dll");
+ ab.DefineVersionInfoResource (string.Empty, string.Empty,
+ string.Empty, string.Empty, string.Empty);
+ ab.Save ("lib1j.dll");
- string assemblyFile = Path.Combine (tempDir, "lib2b.dll");
+ string assemblyFile = Path.Combine (tempDir, "lib1j.dll");
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
- Assert.AreEqual (" ", fvi.Comments, "#1");
- Assert.AreEqual ("Mono Team", fvi.CompanyName, "#2");
- Assert.AreEqual (6, fvi.FileBuildPart, "#3");
+ Assert.AreEqual ("System Test", fvi.Comments, "#1");
+ Assert.AreEqual (" ", fvi.CompanyName, "#2");
+ Assert.AreEqual (8, fvi.FileBuildPart, "#3");
Assert.AreEqual (" ", fvi.FileDescription, "#4");
- Assert.AreEqual (2, fvi.FileMajorPart, "#5");
+ Assert.AreEqual (5, fvi.FileMajorPart, "#5");
Assert.AreEqual (4, fvi.FileMinorPart, "#6");
Assert.AreEqual (assemblyFile, fvi.FileName, "#7");
- Assert.AreEqual (8, fvi.FilePrivatePart, "#8");
- Assert.AreEqual ("2.4.6.8", fvi.FileVersion, "#9");
- Assert.AreEqual ("lib2b", fvi.InternalName, "#10");
+ Assert.AreEqual (2, fvi.FilePrivatePart, "#8");
+ Assert.AreEqual ("5.4.8.2", fvi.FileVersion, "#9");
+ Assert.AreEqual ("lib1j", fvi.InternalName, "#10");
Assert.IsFalse (fvi.IsDebug, "#11");
Assert.IsFalse (fvi.IsPatched, "#12");
Assert.IsFalse (fvi.IsPreRelease, "#13");
Assert.IsFalse (fvi.IsPrivateBuild, "#14");
Assert.IsFalse (fvi.IsSpecialBuild, "#15");
- Assert.AreEqual ("English (United Kingdom)", fvi.Language, "#16");
- Assert.AreEqual ("Copyright 2007 Mono Hackers", fvi.LegalCopyright, "#17");
- Assert.AreEqual ("Registered to All", fvi.LegalTrademarks, "#18");
- Assert.AreEqual ("lib2b.dll", fvi.OriginalFilename, "#19");
+ Assert.AreEqual ("Invariant Language (Invariant Country)", fvi.Language, "#16");
+ Assert.AreEqual (" ", fvi.LegalCopyright, "#17");
+ Assert.AreEqual (" ", fvi.LegalTrademarks, "#18");
+ Assert.AreEqual ("lib1j.dll", fvi.OriginalFilename, "#19");
Assert.AreEqual (string.Empty, fvi.PrivateBuild, "#20");
- Assert.AreEqual (7, fvi.ProductBuildPart, "#21");
- Assert.AreEqual (6, fvi.ProductMajorPart, "#22");
- Assert.AreEqual (4, fvi.ProductMinorPart, "#23");
- Assert.AreEqual ("Mono Runtime", fvi.ProductName, "#24");
- Assert.AreEqual (1, fvi.ProductPrivatePart, "#25");
- Assert.AreEqual ("6.4.7.1", fvi.ProductVersion, "#26");
+ Assert.AreEqual (0, fvi.ProductBuildPart, "#21");
+ Assert.AreEqual (0, fvi.ProductMajorPart, "#22");
+ Assert.AreEqual (0, fvi.ProductMinorPart, "#23");
+ Assert.AreEqual (" ", fvi.ProductName, "#24");
+ Assert.AreEqual (0, fvi.ProductPrivatePart, "#25");
+ Assert.AreEqual (" ", fvi.ProductVersion, "#26");
Assert.AreEqual (string.Empty, fvi.SpecialBuild, "#27");
}
- [Test] // DefineVersionInfoResource ()
- [Category ("NotWorking")]
- public void DefineVersionInfoResource2c ()
+ [Test] // DefineVersionInfoResource (String, String, String, String, String)
+ public void DefineVersionInfoResource1k ()
{
AssemblyName aname = new AssemblyName ();
- aname.Name = "lib2c";
- aname.Version = new Version (3, 5, 7, 9);
+ aname.CultureInfo = new CultureInfo ("nl");
+ aname.Name = "lib1k";
+ aname.Version = new Version (5, 4, 7, 8);
AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
aname, AssemblyBuilderAccess.RunAndSave,
tempDir);
- // AssemblyVersion
- Type attrType = typeof (AssemblyVersionAttribute);
- ConstructorInfo ci = attrType.GetConstructor (new Type [] { typeof (String) });
- CustomAttributeBuilder cab = new CustomAttributeBuilder (ci, new object [1] { "1.2.3.4" });
- ab.SetCustomAttribute (cab);
-
// AssemblyCulture
- attrType = typeof (AssemblyCultureAttribute);
- ci = attrType.GetConstructor (new Type [] { typeof (String) });
- cab = new CustomAttributeBuilder (ci, new object [1] { "en-GB" });
+ Type attrType = typeof (AssemblyCultureAttribute);
+ ConstructorInfo ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ CustomAttributeBuilder cab = new CustomAttributeBuilder (
+ ci, new object [1] { string.Empty });
ab.SetCustomAttribute (cab);
- ab.DefineVersionInfoResource ();
- ab.Save ("lib2c.dll");
+ ab.DefineVersionInfoResource (null, null, null, null, null);
+ ab.Save ("lib1k.dll");
- string assemblyFile = Path.Combine (tempDir, "lib2c.dll");
+ string assemblyFile = Path.Combine (tempDir, "lib1k.dll");
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
Assert.AreEqual (" ", fvi.Comments, "#1");
Assert.AreEqual (" ", fvi.CompanyName, "#2");
Assert.AreEqual (7, fvi.FileBuildPart, "#3");
Assert.AreEqual (" ", fvi.FileDescription, "#4");
- Assert.AreEqual (3, fvi.FileMajorPart, "#5");
- Assert.AreEqual (5, fvi.FileMinorPart, "#6");
+ Assert.AreEqual (5, fvi.FileMajorPart, "#5");
+ Assert.AreEqual (4, fvi.FileMinorPart, "#6");
Assert.AreEqual (assemblyFile, fvi.FileName, "#7");
- Assert.AreEqual (9, fvi.FilePrivatePart, "#8");
- Assert.AreEqual ("3.5.7.9", fvi.FileVersion, "#9");
- Assert.AreEqual ("lib2c", fvi.InternalName, "#10");
+ Assert.AreEqual (8, fvi.FilePrivatePart, "#8");
+ Assert.AreEqual ("5.4.7.8", fvi.FileVersion, "#9");
+ Assert.AreEqual ("lib1k", fvi.InternalName, "#10");
Assert.IsFalse (fvi.IsDebug, "#11");
Assert.IsFalse (fvi.IsPatched, "#12");
Assert.IsFalse (fvi.IsPreRelease, "#13");
Assert.IsFalse (fvi.IsPrivateBuild, "#14");
Assert.IsFalse (fvi.IsSpecialBuild, "#15");
- Assert.AreEqual ("English (United Kingdom)", fvi.Language, "#16");
+ Assert.AreEqual ("Invariant Language (Invariant Country)", fvi.Language, "#16");
Assert.AreEqual (" ", fvi.LegalCopyright, "#17");
Assert.AreEqual (" ", fvi.LegalTrademarks, "#18");
- Assert.AreEqual ("lib2c.dll", fvi.OriginalFilename, "#19");
+ Assert.AreEqual ("lib1k.dll", fvi.OriginalFilename, "#19");
Assert.AreEqual (string.Empty, fvi.PrivateBuild, "#20");
Assert.AreEqual (0, fvi.ProductBuildPart, "#21");
Assert.AreEqual (0, fvi.ProductMajorPart, "#22");
Assert.AreEqual (string.Empty, fvi.SpecialBuild, "#27");
}
- [Test] // DefineVersionInfoResource ()
- [Category ("NotWorking")]
- public void DefineVersionInfoResource2d ()
+ [Test] // DefineVersionInfoResource (String, String, String, String, String)
+ public void DefineVersionInfoResource1l ()
{
AssemblyName aname = new AssemblyName ();
- aname.Name = "lib2d";
- aname.Version = new Version (3, 5, 7, 9);
+ aname.CultureInfo = new CultureInfo ("nl-BE");
+ aname.Name = "lib1l";
+ aname.Version = new Version (5, 4, 7, 8);
AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
aname, AssemblyBuilderAccess.RunAndSave,
tempDir);
+ ab.DefineVersionInfoResource ("AAA", "3.9.2", "BBB", "CCC", "DDD");
+
+ // CompanyName
+ Type attrType = typeof (AssemblyCompanyAttribute);
+ ConstructorInfo ci = attrType.GetConstructor (
+ new Type [] { typeof (String) });
+ CustomAttributeBuilder cab =
+ new CustomAttributeBuilder (ci, new object [1] { "Mono Team" });
+ ab.SetCustomAttribute (cab);
+
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "System Test" });
+ ab.SetCustomAttribute (cab);
+
+ // ProductName
+ attrType = typeof (AssemblyProductAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "Mono Runtime" });
+ ab.SetCustomAttribute (cab);
+
+ // LegalCopyright
+ attrType = typeof (AssemblyCopyrightAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "Copyright 2007 Mono Hackers" });
+ ab.SetCustomAttribute (cab);
+
+ // LegalTrademarks
+ attrType = typeof (AssemblyTrademarkAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "Registered to All" });
+ ab.SetCustomAttribute (cab);
// AssemblyVersion
- Type attrType = typeof (AssemblyVersionAttribute);
- ConstructorInfo ci = attrType.GetConstructor (new Type [] { typeof (String) });
- CustomAttributeBuilder cab = new CustomAttributeBuilder (ci, new object [1] { "1.2.3.4" });
+ attrType = typeof (AssemblyVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "1.2.3.4" });
ab.SetCustomAttribute (cab);
// AssemblyFileVersion
attrType = typeof (AssemblyFileVersionAttribute);
ci = attrType.GetConstructor (new Type [] { typeof (String) });
- cab = new CustomAttributeBuilder (ci, new object [1] { "2.4.6" });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "2.4.6.8" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyInformationalVersion
+ attrType = typeof (AssemblyInformationalVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "6.4.7.1" });
ab.SetCustomAttribute (cab);
// AssemblyCulture
cab = new CustomAttributeBuilder (ci, new object [1] { "en-GB" });
ab.SetCustomAttribute (cab);
- ab.DefineVersionInfoResource ();
- ab.Save ("lib2d.dll");
+ ab.Save ("lib1l.dll");
- string assemblyFile = Path.Combine (tempDir, "lib2d.dll");
+ string assemblyFile = Path.Combine (tempDir, "lib1l.dll");
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
- Assert.AreEqual (" ", fvi.Comments, "#1");
- Assert.AreEqual (" ", fvi.CompanyName, "#2");
- Assert.AreEqual (6, fvi.FileBuildPart, "#3");
+ Assert.AreEqual ("System Test", fvi.Comments, "#1");
+ Assert.AreEqual ("BBB", fvi.CompanyName, "#2");
+ Assert.AreEqual (7, fvi.FileBuildPart, "#3");
Assert.AreEqual (" ", fvi.FileDescription, "#4");
- Assert.AreEqual (2, fvi.FileMajorPart, "#5");
+ Assert.AreEqual (5, fvi.FileMajorPart, "#5");
Assert.AreEqual (4, fvi.FileMinorPart, "#6");
Assert.AreEqual (assemblyFile, fvi.FileName, "#7");
- Assert.AreEqual (0, fvi.FilePrivatePart, "#8");
- Assert.AreEqual ("2.4.6", fvi.FileVersion, "#9");
- Assert.AreEqual ("lib2d", fvi.InternalName, "#10");
+ Assert.AreEqual (8, fvi.FilePrivatePart, "#8");
+ Assert.AreEqual ("5.4.7.8", fvi.FileVersion, "#9");
+ Assert.AreEqual ("lib1l", fvi.InternalName, "#10");
Assert.IsFalse (fvi.IsDebug, "#11");
Assert.IsFalse (fvi.IsPatched, "#12");
Assert.IsFalse (fvi.IsPreRelease, "#13");
Assert.IsFalse (fvi.IsPrivateBuild, "#14");
Assert.IsFalse (fvi.IsSpecialBuild, "#15");
Assert.AreEqual ("English (United Kingdom)", fvi.Language, "#16");
- Assert.AreEqual (" ", fvi.LegalCopyright, "#17");
- Assert.AreEqual (" ", fvi.LegalTrademarks, "#18");
- Assert.AreEqual ("lib2d.dll", fvi.OriginalFilename, "#19");
+ Assert.AreEqual ("CCC", fvi.LegalCopyright, "#17");
+ Assert.AreEqual ("DDD", fvi.LegalTrademarks, "#18");
+ Assert.AreEqual ("lib1l.dll", fvi.OriginalFilename, "#19");
Assert.AreEqual (string.Empty, fvi.PrivateBuild, "#20");
- Assert.AreEqual (0, fvi.ProductBuildPart, "#21");
- Assert.AreEqual (0, fvi.ProductMajorPart, "#22");
- Assert.AreEqual (0, fvi.ProductMinorPart, "#23");
- Assert.AreEqual (" ", fvi.ProductName, "#24");
+ Assert.AreEqual (2, fvi.ProductBuildPart, "#21");
+ Assert.AreEqual (3, fvi.ProductMajorPart, "#22");
+ Assert.AreEqual (9, fvi.ProductMinorPart, "#23");
+ Assert.AreEqual ("AAA", fvi.ProductName, "#24");
Assert.AreEqual (0, fvi.ProductPrivatePart, "#25");
- Assert.AreEqual (" ", fvi.ProductVersion, "#26");
+ Assert.AreEqual ("3.9.2", fvi.ProductVersion, "#26");
Assert.AreEqual (string.Empty, fvi.SpecialBuild, "#27");
}
- [Test] // DefineVersionInfoResource ()
- [Category ("NotWorking")]
- public void DefineVersionInfoResource2e ()
+ [Test] // DefineVersionInfoResource (String, String, String, String, String)
+ public void DefineVersionInfoResource1m ()
{
AssemblyName aname = new AssemblyName ();
- aname.Name = "lib2e";
+ aname.CultureInfo = new CultureInfo ("nl-BE");
+ aname.Name = "lib1m";
+ aname.Version = new Version (5, 4, 7, 8);
+
+ AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
+ aname, AssemblyBuilderAccess.RunAndSave,
+ tempDir);
+ ab.DefineVersionInfoResource (string.Empty, string.Empty,
+ string.Empty, string.Empty, string.Empty);
+
+ // CompanyName
+ Type attrType = typeof (AssemblyCompanyAttribute);
+ ConstructorInfo ci = attrType.GetConstructor (
+ new Type [] { typeof (String) });
+ CustomAttributeBuilder cab =
+ new CustomAttributeBuilder (ci, new object [1] { "Mono Team" });
+ ab.SetCustomAttribute (cab);
+
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "System Test" });
+ ab.SetCustomAttribute (cab);
+
+ // ProductName
+ attrType = typeof (AssemblyProductAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "Mono Runtime" });
+ ab.SetCustomAttribute (cab);
+
+ // LegalCopyright
+ attrType = typeof (AssemblyCopyrightAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "Copyright 2007 Mono Hackers" });
+ ab.SetCustomAttribute (cab);
+
+ // LegalTrademarks
+ attrType = typeof (AssemblyTrademarkAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "Registered to All" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyVersion
+ attrType = typeof (AssemblyVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "1.2.3.4" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyFileVersion
+ attrType = typeof (AssemblyFileVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "2.4.6.8" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyInformationalVersion
+ attrType = typeof (AssemblyInformationalVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "6.4.7.1" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyCulture
+ attrType = typeof (AssemblyCultureAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "en-GB" });
+ ab.SetCustomAttribute (cab);
+
+ ab.Save ("lib1m.dll");
+
+ string assemblyFile = Path.Combine (tempDir, "lib1m.dll");
+
+ FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
+ Assert.AreEqual ("System Test", fvi.Comments, "#1");
+ Assert.AreEqual (" ", fvi.CompanyName, "#2");
+ Assert.AreEqual (7, fvi.FileBuildPart, "#3");
+ Assert.AreEqual (" ", fvi.FileDescription, "#4");
+ Assert.AreEqual (5, fvi.FileMajorPart, "#5");
+ Assert.AreEqual (4, fvi.FileMinorPart, "#6");
+ Assert.AreEqual (assemblyFile, fvi.FileName, "#7");
+ Assert.AreEqual (8, fvi.FilePrivatePart, "#8");
+ Assert.AreEqual ("5.4.7.8", fvi.FileVersion, "#9");
+ Assert.AreEqual ("lib1m", fvi.InternalName, "#10");
+ Assert.IsFalse (fvi.IsDebug, "#11");
+ Assert.IsFalse (fvi.IsPatched, "#12");
+ Assert.IsFalse (fvi.IsPreRelease, "#13");
+ Assert.IsFalse (fvi.IsPrivateBuild, "#14");
+ Assert.IsFalse (fvi.IsSpecialBuild, "#15");
+ Assert.AreEqual ("English (United Kingdom)", fvi.Language, "#16");
+ Assert.AreEqual (" ", fvi.LegalCopyright, "#17");
+ Assert.AreEqual (" ", fvi.LegalTrademarks, "#18");
+ Assert.AreEqual ("lib1m.dll", fvi.OriginalFilename, "#19");
+ Assert.AreEqual (string.Empty, fvi.PrivateBuild, "#20");
+ Assert.AreEqual (0, fvi.ProductBuildPart, "#21");
+ Assert.AreEqual (0, fvi.ProductMajorPart, "#22");
+ Assert.AreEqual (0, fvi.ProductMinorPart, "#23");
+ Assert.AreEqual (" ", fvi.ProductName, "#24");
+ Assert.AreEqual (0, fvi.ProductPrivatePart, "#25");
+ Assert.AreEqual (" ", fvi.ProductVersion, "#26");
+ Assert.AreEqual (string.Empty, fvi.SpecialBuild, "#27");
+ }
+
+ [Test] // DefineVersionInfoResource ()
+ public void DefineVersionInfoResource2a ()
+ {
+ AssemblyName aname = new AssemblyName ();
+ aname.Name = "lib2a";
+
+ AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
+ aname, AssemblyBuilderAccess.RunAndSave,
+ tempDir);
+ ab.DefineVersionInfoResource ();
+ ab.Save ("lib2a.dll");
+
+ string assemblyFile = Path.Combine (tempDir, "lib2a.dll");
+
+ FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
+ Assert.AreEqual (" ", fvi.Comments, "#1");
+ Assert.AreEqual (" ", fvi.CompanyName, "#2");
+ Assert.AreEqual (0, fvi.FileBuildPart, "#3");
+ Assert.AreEqual (" ", fvi.FileDescription, "#4");
+ Assert.AreEqual (0, fvi.FileMajorPart, "#5");
+ Assert.AreEqual (0, fvi.FileMinorPart, "#6");
+ Assert.AreEqual (assemblyFile, fvi.FileName, "#7");
+ Assert.AreEqual (0, fvi.FilePrivatePart, "#8");
+ Assert.AreEqual ("0.0.0.0", fvi.FileVersion, "#9");
+ Assert.AreEqual ("lib2a", fvi.InternalName, "#10");
+ Assert.IsFalse (fvi.IsDebug, "#11");
+ Assert.IsFalse (fvi.IsPatched, "#12");
+ Assert.IsFalse (fvi.IsPreRelease, "#13");
+ Assert.IsFalse (fvi.IsPrivateBuild, "#14");
+ Assert.IsFalse (fvi.IsSpecialBuild, "#15");
+ Assert.AreEqual ("Invariant Language (Invariant Country)", fvi.Language, "#16");
+ Assert.AreEqual (" ", fvi.LegalCopyright, "#17");
+ Assert.AreEqual (" ", fvi.LegalTrademarks, "#18");
+ Assert.AreEqual ("lib2a.dll", fvi.OriginalFilename, "#19");
+ Assert.AreEqual (string.Empty, fvi.PrivateBuild, "#20");
+ Assert.AreEqual (0, fvi.ProductBuildPart, "#21");
+ Assert.AreEqual (0, fvi.ProductMajorPart, "#22");
+ Assert.AreEqual (0, fvi.ProductMinorPart, "#23");
+ Assert.AreEqual (" ", fvi.ProductName, "#24");
+ Assert.AreEqual (0, fvi.ProductPrivatePart, "#25");
+ Assert.AreEqual (" ", fvi.ProductVersion, "#26");
+ Assert.AreEqual (string.Empty, fvi.SpecialBuild, "#27");
+ }
+
+ [Test] // DefineVersionInfoResource ()
+ public void DefineVersionInfoResource2b ()
+ {
+ AssemblyName aname = new AssemblyName ();
+ aname.Name = "lib2b";
+ aname.Version = new Version (3, 5, 7, 9);
+
+ AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
+ aname, AssemblyBuilderAccess.RunAndSave,
+ tempDir);
+
+ // CompanyName
+ Type attrType = typeof (AssemblyCompanyAttribute);
+ ConstructorInfo ci = attrType.GetConstructor (
+ new Type [] { typeof (String) });
+ CustomAttributeBuilder cab =
+ new CustomAttributeBuilder (ci, new object [1] { "Mono Team" });
+ ab.SetCustomAttribute (cab);
+
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "System Test" });
+ ab.SetCustomAttribute (cab);
+
+ // ProductName
+ attrType = typeof (AssemblyProductAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "Mono Runtime" });
+ ab.SetCustomAttribute (cab);
+
+ // LegalCopyright
+ attrType = typeof (AssemblyCopyrightAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "Copyright 2007 Mono Hackers" });
+ ab.SetCustomAttribute (cab);
+
+ // LegalTrademarks
+ attrType = typeof (AssemblyTrademarkAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "Registered to All" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyVersion
+ attrType = typeof (AssemblyVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "1.2.3.4" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyFileVersion
+ attrType = typeof (AssemblyFileVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "2.4.6.8" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyInformationalVersion
+ attrType = typeof (AssemblyInformationalVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "6.4.7.1" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyCulture
+ attrType = typeof (AssemblyCultureAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "en-GB" });
+ ab.SetCustomAttribute (cab);
+
+ ab.DefineVersionInfoResource ();
+ ab.Save ("lib2b.dll");
+
+ string assemblyFile = Path.Combine (tempDir, "lib2b.dll");
+
+ FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
+ Assert.AreEqual ("System Test", fvi.Comments, "#1");
+ Assert.AreEqual ("Mono Team", fvi.CompanyName, "#2");
+ Assert.AreEqual (6, fvi.FileBuildPart, "#3");
+ Assert.AreEqual (" ", fvi.FileDescription, "#4");
+ Assert.AreEqual (2, fvi.FileMajorPart, "#5");
+ Assert.AreEqual (4, fvi.FileMinorPart, "#6");
+ Assert.AreEqual (assemblyFile, fvi.FileName, "#7");
+ Assert.AreEqual (8, fvi.FilePrivatePart, "#8");
+ Assert.AreEqual ("2.4.6.8", fvi.FileVersion, "#9");
+ Assert.AreEqual ("lib2b", fvi.InternalName, "#10");
+ Assert.IsFalse (fvi.IsDebug, "#11");
+ Assert.IsFalse (fvi.IsPatched, "#12");
+ Assert.IsFalse (fvi.IsPreRelease, "#13");
+ Assert.IsFalse (fvi.IsPrivateBuild, "#14");
+ Assert.IsFalse (fvi.IsSpecialBuild, "#15");
+ Assert.AreEqual ("English (United Kingdom)", fvi.Language, "#16");
+ Assert.AreEqual ("Copyright 2007 Mono Hackers", fvi.LegalCopyright, "#17");
+ Assert.AreEqual ("Registered to All", fvi.LegalTrademarks, "#18");
+ Assert.AreEqual ("lib2b.dll", fvi.OriginalFilename, "#19");
+ Assert.AreEqual (string.Empty, fvi.PrivateBuild, "#20");
+ Assert.AreEqual (7, fvi.ProductBuildPart, "#21");
+ Assert.AreEqual (6, fvi.ProductMajorPart, "#22");
+ Assert.AreEqual (4, fvi.ProductMinorPart, "#23");
+ Assert.AreEqual ("Mono Runtime", fvi.ProductName, "#24");
+ Assert.AreEqual (1, fvi.ProductPrivatePart, "#25");
+ Assert.AreEqual ("6.4.7.1", fvi.ProductVersion, "#26");
+ Assert.AreEqual (string.Empty, fvi.SpecialBuild, "#27");
+ }
+
+ [Test] // DefineVersionInfoResource ()
+ public void DefineVersionInfoResource2c ()
+ {
+ AssemblyName aname = new AssemblyName ();
+ aname.Name = "lib2c";
+ aname.Version = new Version (3, 5, 7, 9);
+
+ AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
+ aname, AssemblyBuilderAccess.RunAndSave,
+ tempDir);
+
+ // AssemblyVersion
+ Type attrType = typeof (AssemblyVersionAttribute);
+ ConstructorInfo ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ CustomAttributeBuilder cab = new CustomAttributeBuilder (ci, new object [1] { "1.2.3.4" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyCulture
+ attrType = typeof (AssemblyCultureAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "en-GB" });
+ ab.SetCustomAttribute (cab);
+
+ ab.DefineVersionInfoResource ();
+ ab.Save ("lib2c.dll");
+
+ string assemblyFile = Path.Combine (tempDir, "lib2c.dll");
+
+ FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
+ Assert.AreEqual (" ", fvi.Comments, "#1");
+ Assert.AreEqual (" ", fvi.CompanyName, "#2");
+ Assert.AreEqual (7, fvi.FileBuildPart, "#3");
+ Assert.AreEqual (" ", fvi.FileDescription, "#4");
+ Assert.AreEqual (3, fvi.FileMajorPart, "#5");
+ Assert.AreEqual (5, fvi.FileMinorPart, "#6");
+ Assert.AreEqual (assemblyFile, fvi.FileName, "#7");
+ Assert.AreEqual (9, fvi.FilePrivatePart, "#8");
+ Assert.AreEqual ("3.5.7.9", fvi.FileVersion, "#9");
+ Assert.AreEqual ("lib2c", fvi.InternalName, "#10");
+ Assert.IsFalse (fvi.IsDebug, "#11");
+ Assert.IsFalse (fvi.IsPatched, "#12");
+ Assert.IsFalse (fvi.IsPreRelease, "#13");
+ Assert.IsFalse (fvi.IsPrivateBuild, "#14");
+ Assert.IsFalse (fvi.IsSpecialBuild, "#15");
+ Assert.AreEqual ("English (United Kingdom)", fvi.Language, "#16");
+ Assert.AreEqual (" ", fvi.LegalCopyright, "#17");
+ Assert.AreEqual (" ", fvi.LegalTrademarks, "#18");
+ Assert.AreEqual ("lib2c.dll", fvi.OriginalFilename, "#19");
+ Assert.AreEqual (string.Empty, fvi.PrivateBuild, "#20");
+ Assert.AreEqual (0, fvi.ProductBuildPart, "#21");
+ Assert.AreEqual (0, fvi.ProductMajorPart, "#22");
+ Assert.AreEqual (0, fvi.ProductMinorPart, "#23");
+ Assert.AreEqual (" ", fvi.ProductName, "#24");
+ Assert.AreEqual (0, fvi.ProductPrivatePart, "#25");
+ Assert.AreEqual (" ", fvi.ProductVersion, "#26");
+ Assert.AreEqual (string.Empty, fvi.SpecialBuild, "#27");
+ }
+
+ [Test] // DefineVersionInfoResource ()
+ public void DefineVersionInfoResource2d ()
+ {
+ AssemblyName aname = new AssemblyName ();
+ aname.Name = "lib2d";
+ aname.Version = new Version (3, 5, 7, 9);
+
+ AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
+ aname, AssemblyBuilderAccess.RunAndSave,
+ tempDir);
+
+ // AssemblyVersion
+ Type attrType = typeof (AssemblyVersionAttribute);
+ ConstructorInfo ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ CustomAttributeBuilder cab = new CustomAttributeBuilder (ci, new object [1] { "1.2.3.4" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyFileVersion
+ attrType = typeof (AssemblyFileVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "2.4.6" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyCulture
+ attrType = typeof (AssemblyCultureAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "en-GB" });
+ ab.SetCustomAttribute (cab);
+
+ ab.DefineVersionInfoResource ();
+ ab.Save ("lib2d.dll");
+
+ string assemblyFile = Path.Combine (tempDir, "lib2d.dll");
+
+ FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
+ Assert.AreEqual (" ", fvi.Comments, "#1");
+ Assert.AreEqual (" ", fvi.CompanyName, "#2");
+ Assert.AreEqual (6, fvi.FileBuildPart, "#3");
+ Assert.AreEqual (" ", fvi.FileDescription, "#4");
+ Assert.AreEqual (2, fvi.FileMajorPart, "#5");
+ Assert.AreEqual (4, fvi.FileMinorPart, "#6");
+ Assert.AreEqual (assemblyFile, fvi.FileName, "#7");
+ Assert.AreEqual (0, fvi.FilePrivatePart, "#8");
+ Assert.AreEqual ("2.4.6", fvi.FileVersion, "#9");
+ Assert.AreEqual ("lib2d", fvi.InternalName, "#10");
+ Assert.IsFalse (fvi.IsDebug, "#11");
+ Assert.IsFalse (fvi.IsPatched, "#12");
+ Assert.IsFalse (fvi.IsPreRelease, "#13");
+ Assert.IsFalse (fvi.IsPrivateBuild, "#14");
+ Assert.IsFalse (fvi.IsSpecialBuild, "#15");
+ Assert.AreEqual ("English (United Kingdom)", fvi.Language, "#16");
+ Assert.AreEqual (" ", fvi.LegalCopyright, "#17");
+ Assert.AreEqual (" ", fvi.LegalTrademarks, "#18");
+ Assert.AreEqual ("lib2d.dll", fvi.OriginalFilename, "#19");
+ Assert.AreEqual (string.Empty, fvi.PrivateBuild, "#20");
+ Assert.AreEqual (0, fvi.ProductBuildPart, "#21");
+ Assert.AreEqual (0, fvi.ProductMajorPart, "#22");
+ Assert.AreEqual (0, fvi.ProductMinorPart, "#23");
+ Assert.AreEqual (" ", fvi.ProductName, "#24");
+ Assert.AreEqual (0, fvi.ProductPrivatePart, "#25");
+ Assert.AreEqual (" ", fvi.ProductVersion, "#26");
+ Assert.AreEqual (string.Empty, fvi.SpecialBuild, "#27");
+ }
+
+ [Test] // DefineVersionInfoResource ()
+ public void DefineVersionInfoResource2e ()
+ {
+ AssemblyName aname = new AssemblyName ();
+ aname.Name = "lib2e";
+ aname.Version = new Version (3, 5, 7, 9);
+
+ AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
+ aname, AssemblyBuilderAccess.RunAndSave,
+ tempDir);
+
+ // AssemblyVersion
+ Type attrType = typeof (AssemblyVersionAttribute);
+ ConstructorInfo ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ CustomAttributeBuilder cab = new CustomAttributeBuilder (ci, new object [1] { "1.2.3.4" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyFileVersion
+ attrType = typeof (AssemblyFileVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "0.0.0.0" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyCulture
+ attrType = typeof (AssemblyCultureAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "en-GB" });
+ ab.SetCustomAttribute (cab);
+
+ ab.DefineVersionInfoResource ();
+ ab.Save ("lib2e.dll");
+
+ string assemblyFile = Path.Combine (tempDir, "lib2e.dll");
+
+ FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
+ Assert.AreEqual (" ", fvi.Comments, "#1");
+ Assert.AreEqual (" ", fvi.CompanyName, "#2");
+ Assert.AreEqual (0, fvi.FileBuildPart, "#3");
+ Assert.AreEqual (" ", fvi.FileDescription, "#4");
+ Assert.AreEqual (0, fvi.FileMajorPart, "#5");
+ Assert.AreEqual (0, fvi.FileMinorPart, "#6");
+ Assert.AreEqual (assemblyFile, fvi.FileName, "#7");
+ Assert.AreEqual (0, fvi.FilePrivatePart, "#8");
+ Assert.AreEqual ("0.0.0.0", fvi.FileVersion, "#9");
+ Assert.AreEqual ("lib2e", fvi.InternalName, "#10");
+ Assert.IsFalse (fvi.IsDebug, "#11");
+ Assert.IsFalse (fvi.IsPatched, "#12");
+ Assert.IsFalse (fvi.IsPreRelease, "#13");
+ Assert.IsFalse (fvi.IsPrivateBuild, "#14");
+ Assert.IsFalse (fvi.IsSpecialBuild, "#15");
+ Assert.AreEqual ("English (United Kingdom)", fvi.Language, "#16");
+ Assert.AreEqual (" ", fvi.LegalCopyright, "#17");
+ Assert.AreEqual (" ", fvi.LegalTrademarks, "#18");
+ Assert.AreEqual ("lib2e.dll", fvi.OriginalFilename, "#19");
+ Assert.AreEqual (string.Empty, fvi.PrivateBuild, "#20");
+ Assert.AreEqual (0, fvi.ProductBuildPart, "#21");
+ Assert.AreEqual (0, fvi.ProductMajorPart, "#22");
+ Assert.AreEqual (0, fvi.ProductMinorPart, "#23");
+ Assert.AreEqual (" ", fvi.ProductName, "#24");
+ Assert.AreEqual (0, fvi.ProductPrivatePart, "#25");
+ Assert.AreEqual (" ", fvi.ProductVersion, "#26");
+ Assert.AreEqual (string.Empty, fvi.SpecialBuild, "#27");
+ }
+
+ [Test] // DefineVersionInfoResource ()
+ public void DefineVersionInfoResource2f ()
+ {
+ AssemblyName aname = new AssemblyName ();
+ aname.CultureInfo = new CultureInfo ("nl-BE");
+ aname.Name = "lib2f";
+ aname.Version = new Version (3, 5, 7);
+
+ AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
+ aname, AssemblyBuilderAccess.RunAndSave,
+ tempDir);
+
+ ab.DefineVersionInfoResource ();
+ ab.Save ("lib2f.dll");
+
+ string assemblyFile = Path.Combine (tempDir, "lib2f.dll");
+
+ FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
+ Assert.AreEqual (" ", fvi.Comments, "#1");
+ Assert.AreEqual (" ", fvi.CompanyName, "#2");
+ Assert.AreEqual (7, fvi.FileBuildPart, "#3");
+ Assert.AreEqual (" ", fvi.FileDescription, "#4");
+ Assert.AreEqual (3, fvi.FileMajorPart, "#5");
+ Assert.AreEqual (5, fvi.FileMinorPart, "#6");
+ Assert.AreEqual (assemblyFile, fvi.FileName, "#7");
+#if NET_2_0
+ Assert.AreEqual (0, fvi.FilePrivatePart, "#8");
+ Assert.AreEqual ("3.5.7.0", fvi.FileVersion, "#9");
+#else
+ Assert.AreEqual (65535, fvi.FilePrivatePart, "#8");
+ Assert.AreEqual ("3.5.7.65535", fvi.FileVersion, "#9");
+#endif
+ Assert.AreEqual ("lib2f", fvi.InternalName, "#10");
+ Assert.IsFalse (fvi.IsDebug, "#11");
+ Assert.IsFalse (fvi.IsPatched, "#12");
+ Assert.IsFalse (fvi.IsPreRelease, "#13");
+ Assert.IsFalse (fvi.IsPrivateBuild, "#14");
+ Assert.IsFalse (fvi.IsSpecialBuild, "#15");
+ Assert.AreEqual ("Dutch (Belgium)", fvi.Language, "#16");
+ Assert.AreEqual (" ", fvi.LegalCopyright, "#17");
+ Assert.AreEqual (" ", fvi.LegalTrademarks, "#18");
+ Assert.AreEqual ("lib2f.dll", fvi.OriginalFilename, "#19");
+ Assert.AreEqual (string.Empty, fvi.PrivateBuild, "#20");
+ Assert.AreEqual (0, fvi.ProductBuildPart, "#21");
+ Assert.AreEqual (0, fvi.ProductMajorPart, "#22");
+ Assert.AreEqual (0, fvi.ProductMinorPart, "#23");
+ Assert.AreEqual (" ", fvi.ProductName, "#24");
+ Assert.AreEqual (0, fvi.ProductPrivatePart, "#25");
+ Assert.AreEqual (" ", fvi.ProductVersion, "#26");
+ Assert.AreEqual (string.Empty, fvi.SpecialBuild, "#27");
+ }
+
+ [Test] // DefineVersionInfoResource ()
+ public void DefineVersionInfoResource2g ()
+ {
+ AssemblyName aname = new AssemblyName ();
+ aname.CultureInfo = new CultureInfo ("nl-BE");
+ aname.Name = "lib2g";
aname.Version = new Version (3, 5, 7, 9);
- AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
- aname, AssemblyBuilderAccess.RunAndSave,
- tempDir);
+ AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
+ aname, AssemblyBuilderAccess.RunAndSave,
+ tempDir);
+
+ // CompanyName
+ Type attrType = typeof (AssemblyCompanyAttribute);
+ ConstructorInfo ci = attrType.GetConstructor (
+ new Type [] { typeof (String) });
+ CustomAttributeBuilder cab =
+ new CustomAttributeBuilder (ci, new object [1] { "Mono Team" });
+ ab.SetCustomAttribute (cab);
+
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "System Test" });
+ ab.SetCustomAttribute (cab);
+
+ // ProductName
+ attrType = typeof (AssemblyProductAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "Mono Runtime" });
+ ab.SetCustomAttribute (cab);
+
+ // LegalCopyright
+ attrType = typeof (AssemblyCopyrightAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "Copyright 2007 Mono Hackers" });
+ ab.SetCustomAttribute (cab);
+
+ // LegalTrademarks
+ attrType = typeof (AssemblyTrademarkAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "Registered to All" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyVersion
+ attrType = typeof (AssemblyVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "1.2.3.4" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyFileVersion
+ attrType = typeof (AssemblyFileVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "2.4.6" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyInformationalVersion
+ attrType = typeof (AssemblyInformationalVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "6.4.7" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyCulture
+ attrType = typeof (AssemblyCultureAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "en-GB" });
+ ab.SetCustomAttribute (cab);
+
+ ab.DefineVersionInfoResource ();
+ ab.Save ("lib2b.dll");
+
+ string assemblyFile = Path.Combine (tempDir, "lib2b.dll");
+
+ FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
+ Assert.AreEqual ("System Test", fvi.Comments, "#1");
+ Assert.AreEqual ("Mono Team", fvi.CompanyName, "#2");
+ Assert.AreEqual (6, fvi.FileBuildPart, "#3");
+ Assert.AreEqual (" ", fvi.FileDescription, "#4");
+ Assert.AreEqual (2, fvi.FileMajorPart, "#5");
+ Assert.AreEqual (4, fvi.FileMinorPart, "#6");
+ Assert.AreEqual (assemblyFile, fvi.FileName, "#7");
+ Assert.AreEqual (0, fvi.FilePrivatePart, "#8");
+ Assert.AreEqual ("2.4.6", fvi.FileVersion, "#9");
+ Assert.AreEqual ("lib2b", fvi.InternalName, "#10");
+ Assert.IsFalse (fvi.IsDebug, "#11");
+ Assert.IsFalse (fvi.IsPatched, "#12");
+ Assert.IsFalse (fvi.IsPreRelease, "#13");
+ Assert.IsFalse (fvi.IsPrivateBuild, "#14");
+ Assert.IsFalse (fvi.IsSpecialBuild, "#15");
+ Assert.AreEqual ("English (United Kingdom)", fvi.Language, "#16");
+ Assert.AreEqual ("Copyright 2007 Mono Hackers", fvi.LegalCopyright, "#17");
+ Assert.AreEqual ("Registered to All", fvi.LegalTrademarks, "#18");
+ Assert.AreEqual ("lib2b.dll", fvi.OriginalFilename, "#19");
+ Assert.AreEqual (string.Empty, fvi.PrivateBuild, "#20");
+ Assert.AreEqual (7, fvi.ProductBuildPart, "#21");
+ Assert.AreEqual (6, fvi.ProductMajorPart, "#22");
+ Assert.AreEqual (4, fvi.ProductMinorPart, "#23");
+ Assert.AreEqual ("Mono Runtime", fvi.ProductName, "#24");
+ Assert.AreEqual (0, fvi.ProductPrivatePart, "#25");
+ Assert.AreEqual ("6.4.7", fvi.ProductVersion, "#26");
+ Assert.AreEqual (string.Empty, fvi.SpecialBuild, "#27");
+ }
+
+ [Test] // DefineVersionInfoResource ()
+ public void DefineVersionInfoResource2h ()
+ {
+ AssemblyName aname = new AssemblyName ();
+ aname.CultureInfo = new CultureInfo ("nl-BE");
+ aname.Name = "lib2h";
+ aname.Version = new Version (3, 5, 7);
+
+ AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
+ aname, AssemblyBuilderAccess.RunAndSave,
+ tempDir);
+
+ // CompanyName
+ Type attrType = typeof (AssemblyCompanyAttribute);
+ ConstructorInfo ci = attrType.GetConstructor (
+ new Type [] { typeof (String) });
+ CustomAttributeBuilder cab =
+ new CustomAttributeBuilder (ci, new object [1] { "Mono Team" });
+ ab.SetCustomAttribute (cab);
+
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "System Test" });
+ ab.SetCustomAttribute (cab);
+
+ // ProductName
+ attrType = typeof (AssemblyProductAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "Mono Runtime" });
+ ab.SetCustomAttribute (cab);
+
+ // LegalCopyright
+ attrType = typeof (AssemblyCopyrightAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "Copyright 2007 Mono Hackers" });
+ ab.SetCustomAttribute (cab);
+
+ // LegalTrademarks
+ attrType = typeof (AssemblyTrademarkAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "Registered to All" });
+ ab.SetCustomAttribute (cab);
// AssemblyVersion
- Type attrType = typeof (AssemblyVersionAttribute);
- ConstructorInfo ci = attrType.GetConstructor (new Type [] { typeof (String) });
- CustomAttributeBuilder cab = new CustomAttributeBuilder (ci, new object [1] { "1.2.3.4" });
+ attrType = typeof (AssemblyVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "1.2.3.4" });
ab.SetCustomAttribute (cab);
// AssemblyFileVersion
attrType = typeof (AssemblyFileVersionAttribute);
ci = attrType.GetConstructor (new Type [] { typeof (String) });
- cab = new CustomAttributeBuilder (ci, new object [1] { "0.0.0.0" });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "2.4.6" });
ab.SetCustomAttribute (cab);
- // AssemblyCulture
- attrType = typeof (AssemblyCultureAttribute);
+ // AssemblyInformationalVersion
+ attrType = typeof (AssemblyInformationalVersionAttribute);
ci = attrType.GetConstructor (new Type [] { typeof (String) });
- cab = new CustomAttributeBuilder (ci, new object [1] { "en-GB" });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "6.4.7" });
ab.SetCustomAttribute (cab);
ab.DefineVersionInfoResource ();
- ab.Save ("lib2e.dll");
+ ab.Save ("lib2h.dll");
- string assemblyFile = Path.Combine (tempDir, "lib2e.dll");
+ string assemblyFile = Path.Combine (tempDir, "lib2h.dll");
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
- Assert.AreEqual (" ", fvi.Comments, "#1");
- Assert.AreEqual (" ", fvi.CompanyName, "#2");
- Assert.AreEqual (0, fvi.FileBuildPart, "#3");
+ Assert.AreEqual ("System Test", fvi.Comments, "#1");
+ Assert.AreEqual ("Mono Team", fvi.CompanyName, "#2");
+ Assert.AreEqual (6, fvi.FileBuildPart, "#3");
Assert.AreEqual (" ", fvi.FileDescription, "#4");
- Assert.AreEqual (0, fvi.FileMajorPart, "#5");
- Assert.AreEqual (0, fvi.FileMinorPart, "#6");
+ Assert.AreEqual (2, fvi.FileMajorPart, "#5");
+ Assert.AreEqual (4, fvi.FileMinorPart, "#6");
Assert.AreEqual (assemblyFile, fvi.FileName, "#7");
Assert.AreEqual (0, fvi.FilePrivatePart, "#8");
- Assert.AreEqual ("0.0.0.0", fvi.FileVersion, "#9");
- Assert.AreEqual ("lib2e", fvi.InternalName, "#10");
+ Assert.AreEqual ("2.4.6", fvi.FileVersion, "#9");
+ Assert.AreEqual ("lib2h", fvi.InternalName, "#10");
Assert.IsFalse (fvi.IsDebug, "#11");
Assert.IsFalse (fvi.IsPatched, "#12");
Assert.IsFalse (fvi.IsPreRelease, "#13");
Assert.IsFalse (fvi.IsPrivateBuild, "#14");
Assert.IsFalse (fvi.IsSpecialBuild, "#15");
- Assert.AreEqual ("English (United Kingdom)", fvi.Language, "#16");
- Assert.AreEqual (" ", fvi.LegalCopyright, "#17");
- Assert.AreEqual (" ", fvi.LegalTrademarks, "#18");
- Assert.AreEqual ("lib2e.dll", fvi.OriginalFilename, "#19");
+ Assert.AreEqual ("Dutch (Belgium)", fvi.Language, "#16");
+ Assert.AreEqual ("Copyright 2007 Mono Hackers", fvi.LegalCopyright, "#17");
+ Assert.AreEqual ("Registered to All", fvi.LegalTrademarks, "#18");
+ Assert.AreEqual ("lib2h.dll", fvi.OriginalFilename, "#19");
Assert.AreEqual (string.Empty, fvi.PrivateBuild, "#20");
- Assert.AreEqual (0, fvi.ProductBuildPart, "#21");
- Assert.AreEqual (0, fvi.ProductMajorPart, "#22");
- Assert.AreEqual (0, fvi.ProductMinorPart, "#23");
- Assert.AreEqual (" ", fvi.ProductName, "#24");
+ Assert.AreEqual (7, fvi.ProductBuildPart, "#21");
+ Assert.AreEqual (6, fvi.ProductMajorPart, "#22");
+ Assert.AreEqual (4, fvi.ProductMinorPart, "#23");
+ Assert.AreEqual ("Mono Runtime", fvi.ProductName, "#24");
Assert.AreEqual (0, fvi.ProductPrivatePart, "#25");
- Assert.AreEqual (" ", fvi.ProductVersion, "#26");
+ Assert.AreEqual ("6.4.7", fvi.ProductVersion, "#26");
Assert.AreEqual (string.Empty, fvi.SpecialBuild, "#27");
}
[Test] // DefineVersionInfoResource ()
- [Category ("NotWorking")]
- public void DefineVersionInfoResource2f ()
+ public void DefineVersionInfoResource2i ()
{
AssemblyName aname = new AssemblyName ();
aname.CultureInfo = new CultureInfo ("nl-BE");
- aname.Name = "lib2f";
+ aname.Name = "lib2i";
aname.Version = new Version (3, 5, 7);
AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
aname, AssemblyBuilderAccess.RunAndSave,
tempDir);
+ // CompanyName
+ Type attrType = typeof (AssemblyCompanyAttribute);
+ ConstructorInfo ci = attrType.GetConstructor (
+ new Type [] { typeof (String) });
+ CustomAttributeBuilder cab =
+ new CustomAttributeBuilder (ci, new object [1] { string.Empty });
+ ab.SetCustomAttribute (cab);
+
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { string.Empty });
+ ab.SetCustomAttribute (cab);
+
+ // ProductName
+ attrType = typeof (AssemblyProductAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { string.Empty });
+ ab.SetCustomAttribute (cab);
+
+ // LegalCopyright
+ attrType = typeof (AssemblyCopyrightAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { string.Empty });
+ ab.SetCustomAttribute (cab);
+
+ // LegalTrademarks
+ attrType = typeof (AssemblyTrademarkAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { string.Empty });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyVersion
+ attrType = typeof (AssemblyVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { string.Empty });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyFileVersion
+ attrType = typeof (AssemblyFileVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { string.Empty });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyInformationalVersion
+ attrType = typeof (AssemblyInformationalVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { string.Empty });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyCulture
+ attrType = typeof (AssemblyCultureAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { string.Empty });
+ ab.SetCustomAttribute (cab);
+
ab.DefineVersionInfoResource ();
- ab.Save ("lib2f.dll");
+ ab.Save ("lib2i.dll");
- string assemblyFile = Path.Combine (tempDir, "lib2f.dll");
+ string assemblyFile = Path.Combine (tempDir, "lib2i.dll");
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
Assert.AreEqual (" ", fvi.Comments, "#1");
Assert.AreEqual (" ", fvi.CompanyName, "#2");
- Assert.AreEqual (7, fvi.FileBuildPart, "#3");
+ Assert.AreEqual (0, fvi.FileBuildPart, "#3");
Assert.AreEqual (" ", fvi.FileDescription, "#4");
- Assert.AreEqual (3, fvi.FileMajorPart, "#5");
- Assert.AreEqual (5, fvi.FileMinorPart, "#6");
+ Assert.AreEqual (0, fvi.FileMajorPart, "#5");
+ Assert.AreEqual (0, fvi.FileMinorPart, "#6");
Assert.AreEqual (assemblyFile, fvi.FileName, "#7");
-#if NET_2_0
Assert.AreEqual (0, fvi.FilePrivatePart, "#8");
- Assert.AreEqual ("3.5.7.0", fvi.FileVersion, "#9");
-#else
- Assert.AreEqual (65535, fvi.FilePrivatePart, "#8");
- Assert.AreEqual ("3.5.7.65535", fvi.FileVersion, "#9");
-#endif
- Assert.AreEqual ("lib2f", fvi.InternalName, "#10");
+ Assert.AreEqual (" ", fvi.FileVersion, "#9");
+ Assert.AreEqual ("lib2i", fvi.InternalName, "#10");
Assert.IsFalse (fvi.IsDebug, "#11");
Assert.IsFalse (fvi.IsPatched, "#12");
Assert.IsFalse (fvi.IsPreRelease, "#13");
Assert.IsFalse (fvi.IsPrivateBuild, "#14");
Assert.IsFalse (fvi.IsSpecialBuild, "#15");
- Assert.AreEqual ("Dutch (Belgium)", fvi.Language, "#16");
+ Assert.AreEqual ("Invariant Language (Invariant Country)", fvi.Language, "#16");
Assert.AreEqual (" ", fvi.LegalCopyright, "#17");
Assert.AreEqual (" ", fvi.LegalTrademarks, "#18");
- Assert.AreEqual ("lib2f.dll", fvi.OriginalFilename, "#19");
+ Assert.AreEqual ("lib2i.dll", fvi.OriginalFilename, "#19");
Assert.AreEqual (string.Empty, fvi.PrivateBuild, "#20");
Assert.AreEqual (0, fvi.ProductBuildPart, "#21");
Assert.AreEqual (0, fvi.ProductMajorPart, "#22");
}
[Test] // DefineVersionInfoResource ()
- [Category ("NotWorking")]
- public void DefineVersionInfoResource2g ()
+ public void DefineVersionInfoResource2j ()
{
AssemblyName aname = new AssemblyName ();
aname.CultureInfo = new CultureInfo ("nl-BE");
- aname.Name = "lib2g";
+ aname.Name = "lib2j";
aname.Version = new Version (3, 5, 7, 9);
AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
aname, AssemblyBuilderAccess.RunAndSave,
tempDir);
+ ab.DefineVersionInfoResource ();
// CompanyName
Type attrType = typeof (AssemblyCompanyAttribute);
new CustomAttributeBuilder (ci, new object [1] { "Mono Team" });
ab.SetCustomAttribute (cab);
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "System Test" });
+ ab.SetCustomAttribute (cab);
+
// ProductName
attrType = typeof (AssemblyProductAttribute);
ci = attrType.GetConstructor (new Type [] { typeof (String) });
cab = new CustomAttributeBuilder (ci, new object [1] { "en-GB" });
ab.SetCustomAttribute (cab);
- ab.DefineVersionInfoResource ();
- ab.Save ("lib2b.dll");
+ ab.Save ("lib2j.dll");
- string assemblyFile = Path.Combine (tempDir, "lib2b.dll");
+ string assemblyFile = Path.Combine (tempDir, "lib2j.dll");
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
- Assert.AreEqual (" ", fvi.Comments, "#1");
+ Assert.AreEqual ("System Test", fvi.Comments, "#1");
Assert.AreEqual ("Mono Team", fvi.CompanyName, "#2");
Assert.AreEqual (6, fvi.FileBuildPart, "#3");
Assert.AreEqual (" ", fvi.FileDescription, "#4");
Assert.AreEqual (assemblyFile, fvi.FileName, "#7");
Assert.AreEqual (0, fvi.FilePrivatePart, "#8");
Assert.AreEqual ("2.4.6", fvi.FileVersion, "#9");
- Assert.AreEqual ("lib2b", fvi.InternalName, "#10");
+ Assert.AreEqual ("lib2j", fvi.InternalName, "#10");
Assert.IsFalse (fvi.IsDebug, "#11");
Assert.IsFalse (fvi.IsPatched, "#12");
Assert.IsFalse (fvi.IsPreRelease, "#13");
Assert.AreEqual ("English (United Kingdom)", fvi.Language, "#16");
Assert.AreEqual ("Copyright 2007 Mono Hackers", fvi.LegalCopyright, "#17");
Assert.AreEqual ("Registered to All", fvi.LegalTrademarks, "#18");
- Assert.AreEqual ("lib2b.dll", fvi.OriginalFilename, "#19");
+ Assert.AreEqual ("lib2j.dll", fvi.OriginalFilename, "#19");
Assert.AreEqual (string.Empty, fvi.PrivateBuild, "#20");
Assert.AreEqual (7, fvi.ProductBuildPart, "#21");
Assert.AreEqual (6, fvi.ProductMajorPart, "#22");
}
[Test] // DefineVersionInfoResource ()
- [Category ("NotWorking")]
- public void DefineVersionInfoResource2h ()
+ public void DefineVersionInfoResource2k ()
{
AssemblyName aname = new AssemblyName ();
aname.CultureInfo = new CultureInfo ("nl-BE");
- aname.Name = "lib2h";
+ aname.Name = "lib2k";
aname.Version = new Version (3, 5, 7);
AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
new CustomAttributeBuilder (ci, new object [1] { "Mono Team" });
ab.SetCustomAttribute (cab);
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "System Test" });
+ ab.SetCustomAttribute (cab);
+
// ProductName
attrType = typeof (AssemblyProductAttribute);
ci = attrType.GetConstructor (new Type [] { typeof (String) });
// AssemblyFileVersion
attrType = typeof (AssemblyFileVersionAttribute);
ci = attrType.GetConstructor (new Type [] { typeof (String) });
- cab = new CustomAttributeBuilder (ci, new object [1] { "2.4.6" });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "abc" });
ab.SetCustomAttribute (cab);
// AssemblyInformationalVersion
attrType = typeof (AssemblyInformationalVersionAttribute);
ci = attrType.GetConstructor (new Type [] { typeof (String) });
- cab = new CustomAttributeBuilder (ci, new object [1] { "6.4.7" });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "def" });
ab.SetCustomAttribute (cab);
ab.DefineVersionInfoResource ();
- ab.Save ("lib2h.dll");
+ ab.Save ("lib2k.dll");
- string assemblyFile = Path.Combine (tempDir, "lib2h.dll");
+ string assemblyFile = Path.Combine (tempDir, "lib2k.dll");
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
- Assert.AreEqual (" ", fvi.Comments, "#1");
+ Assert.AreEqual ("System Test", fvi.Comments, "#1");
Assert.AreEqual ("Mono Team", fvi.CompanyName, "#2");
- Assert.AreEqual (6, fvi.FileBuildPart, "#3");
+ Assert.AreEqual (0, fvi.FileBuildPart, "#3");
Assert.AreEqual (" ", fvi.FileDescription, "#4");
- Assert.AreEqual (2, fvi.FileMajorPart, "#5");
- Assert.AreEqual (4, fvi.FileMinorPart, "#6");
+ Assert.AreEqual (0, fvi.FileMajorPart, "#5");
+ Assert.AreEqual (0, fvi.FileMinorPart, "#6");
Assert.AreEqual (assemblyFile, fvi.FileName, "#7");
Assert.AreEqual (0, fvi.FilePrivatePart, "#8");
- Assert.AreEqual ("2.4.6", fvi.FileVersion, "#9");
- Assert.AreEqual ("lib2h", fvi.InternalName, "#10");
+ Assert.AreEqual ("abc", fvi.FileVersion, "#9");
+ Assert.AreEqual ("lib2k", fvi.InternalName, "#10");
Assert.IsFalse (fvi.IsDebug, "#11");
Assert.IsFalse (fvi.IsPatched, "#12");
Assert.IsFalse (fvi.IsPreRelease, "#13");
Assert.AreEqual ("Dutch (Belgium)", fvi.Language, "#16");
Assert.AreEqual ("Copyright 2007 Mono Hackers", fvi.LegalCopyright, "#17");
Assert.AreEqual ("Registered to All", fvi.LegalTrademarks, "#18");
- Assert.AreEqual ("lib2h.dll", fvi.OriginalFilename, "#19");
+ Assert.AreEqual ("lib2k.dll", fvi.OriginalFilename, "#19");
Assert.AreEqual (string.Empty, fvi.PrivateBuild, "#20");
- Assert.AreEqual (7, fvi.ProductBuildPart, "#21");
- Assert.AreEqual (6, fvi.ProductMajorPart, "#22");
- Assert.AreEqual (4, fvi.ProductMinorPart, "#23");
+ Assert.AreEqual (0, fvi.ProductBuildPart, "#21");
+ Assert.AreEqual (0, fvi.ProductMajorPart, "#22");
+ Assert.AreEqual (0, fvi.ProductMinorPart, "#23");
Assert.AreEqual ("Mono Runtime", fvi.ProductName, "#24");
Assert.AreEqual (0, fvi.ProductPrivatePart, "#25");
- Assert.AreEqual ("6.4.7", fvi.ProductVersion, "#26");
+ Assert.AreEqual ("def", fvi.ProductVersion, "#26");
+ Assert.AreEqual (string.Empty, fvi.SpecialBuild, "#27");
+ }
+
+ [Test] // DefineVersionInfoResource ()
+ public void DefineVersionInfoResource2l ()
+ {
+ AssemblyName aname = new AssemblyName ();
+ aname.CultureInfo = new CultureInfo ("nl-BE");
+ aname.Name = "lib2l";
+ aname.Version = new Version (3, 5, 7);
+
+ AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
+ aname, AssemblyBuilderAccess.RunAndSave,
+ tempDir);
+
+ // CompanyName
+ Type attrType = typeof (AssemblyCompanyAttribute);
+ ConstructorInfo ci = attrType.GetConstructor (
+ new Type [] { typeof (String) });
+ CustomAttributeBuilder cab =
+ new CustomAttributeBuilder (ci, new object [1] { "Mono Team" });
+ ab.SetCustomAttribute (cab);
+
+ // Comments
+ attrType = typeof (AssemblyDescriptionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "System Test" });
+ ab.SetCustomAttribute (cab);
+
+ // ProductName
+ attrType = typeof (AssemblyProductAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "Mono Runtime" });
+ ab.SetCustomAttribute (cab);
+
+ // LegalCopyright
+ attrType = typeof (AssemblyCopyrightAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "Copyright 2007 Mono Hackers" });
+ ab.SetCustomAttribute (cab);
+
+ // LegalTrademarks
+ attrType = typeof (AssemblyTrademarkAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "Registered to All" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyVersion
+ attrType = typeof (AssemblyVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "1.2.3.4" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyFileVersion
+ attrType = typeof (AssemblyFileVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "1.b.3.c" });
+ ab.SetCustomAttribute (cab);
+
+ // AssemblyInformationalVersion
+ attrType = typeof (AssemblyInformationalVersionAttribute);
+ ci = attrType.GetConstructor (new Type [] { typeof (String) });
+ cab = new CustomAttributeBuilder (ci, new object [1] { "b.3.6.c" });
+ ab.SetCustomAttribute (cab);
+
+ ab.DefineVersionInfoResource ();
+ ab.Save ("lib2l.dll");
+
+ string assemblyFile = Path.Combine (tempDir, "lib2l.dll");
+
+ FileVersionInfo fvi = FileVersionInfo.GetVersionInfo (assemblyFile);
+ Assert.AreEqual ("System Test", fvi.Comments, "#1");
+ Assert.AreEqual ("Mono Team", fvi.CompanyName, "#2");
+ Assert.AreEqual (0, fvi.FileBuildPart, "#3");
+ Assert.AreEqual (" ", fvi.FileDescription, "#4");
+ Assert.AreEqual (1, fvi.FileMajorPart, "#5");
+ Assert.AreEqual (0, fvi.FileMinorPart, "#6");
+ Assert.AreEqual (assemblyFile, fvi.FileName, "#7");
+ Assert.AreEqual (0, fvi.FilePrivatePart, "#8");
+ Assert.AreEqual ("1.b.3.c", fvi.FileVersion, "#9");
+ Assert.AreEqual ("lib2l", fvi.InternalName, "#10");
+ Assert.IsFalse (fvi.IsDebug, "#11");
+ Assert.IsFalse (fvi.IsPatched, "#12");
+ Assert.IsFalse (fvi.IsPreRelease, "#13");
+ Assert.IsFalse (fvi.IsPrivateBuild, "#14");
+ Assert.IsFalse (fvi.IsSpecialBuild, "#15");
+ Assert.AreEqual ("Dutch (Belgium)", fvi.Language, "#16");
+ Assert.AreEqual ("Copyright 2007 Mono Hackers", fvi.LegalCopyright, "#17");
+ Assert.AreEqual ("Registered to All", fvi.LegalTrademarks, "#18");
+ Assert.AreEqual ("lib2l.dll", fvi.OriginalFilename, "#19");
+ Assert.AreEqual (string.Empty, fvi.PrivateBuild, "#20");
+ Assert.AreEqual (0, fvi.ProductBuildPart, "#21");
+ Assert.AreEqual (0, fvi.ProductMajorPart, "#22");
+ Assert.AreEqual (0, fvi.ProductMinorPart, "#23");
+ Assert.AreEqual ("Mono Runtime", fvi.ProductName, "#24");
+ Assert.AreEqual (0, fvi.ProductPrivatePart, "#25");
+ Assert.AreEqual ("b.3.6.c", fvi.ProductVersion, "#26");
Assert.AreEqual (string.Empty, fvi.SpecialBuild, "#27");
}