(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / class / corlib / Test / System.Reflection / AssemblyInformationalVersionAttributeTest.cs
blob19661974066839a1f7a92b15816607f0d60ef0d0
1 // AssemblyInformationalVersionAttributeTest.cs
2 //
3 // Author: Vineeth N <nvineeth@yahoo.com>
4 //
5 // (C) 2004 Ximian, Inc. http://www.ximian.com
6 //
7 using System;
8 using System.Threading;
9 using System.Reflection;
10 using System.Reflection.Emit;
11 using NUnit.Framework;
13 namespace MonoTests.System.Reflection {
15 /// <summary>
16 /// Test Fixture for AssemblyInformationalVersionAttribute.
17 /// </summary>
18 [TestFixture]
19 public class AssemblyInformationalVersionAttributeTest : Assertion {
21 private AssemblyBuilder dynAssembly;
22 AssemblyName dynAsmName = new AssemblyName ();
23 AssemblyInformationalVersionAttribute attr;
25 public AssemblyInformationalVersionAttributeTest ()
27 //create a dynamic assembly with the required attribute
28 //and check for the validity
30 dynAsmName.Name = "TestAssembly";
32 dynAssembly = Thread.GetDomain ().DefineDynamicAssembly (
33 dynAsmName,AssemblyBuilderAccess.Run
36 // Set the required Attribute of the assembly.
37 Type attribute = typeof (AssemblyInformationalVersionAttribute);
38 ConstructorInfo ctrInfo = attribute.GetConstructor (
39 new Type [] { typeof (string) }
41 CustomAttributeBuilder attrBuilder =
42 new CustomAttributeBuilder (ctrInfo, new object [1] { "2.0.0.0" });
43 dynAssembly.SetCustomAttribute (attrBuilder);
44 object [] attributes = dynAssembly.GetCustomAttributes (true);
45 attr = attributes [0] as AssemblyInformationalVersionAttribute;
48 [Test]
49 public void InformationalVersionTest ()
51 AssertEquals ("#Testing InformationalVersion",
52 attr.InformationalVersion,
53 "2.0.0.0");
56 [Test]
57 public void TypeIdTest ()
59 AssertEquals ("#testing Typeid",
60 attr.TypeId,
61 typeof (AssemblyInformationalVersionAttribute)
66 [Test]
67 public void MatchTestForTrue ()
69 AssertEquals ("#testing Match method-- for true",
70 attr.Match (attr),
71 true);
73 [Test]
74 public void MatchTestForFalse ()
77 AssertEquals ("#testing Match method-- for false",
78 attr.Match (new AssemblyInformationalVersionAttribute ("Descrptn")),
79 false);