merging the Mainsoft branch to the trunk
[mono.git] / mcs / class / corlib / Test / System.Reflection / PropertyInfoTest.cs
1 //
2 // PropertyInfoTest.cs - NUnit Test Cases for PropertyInfo
3 //
4 // Author:
5 //      Gert Driesen (drieseng@users.sourceforge.net)
6 //
7 // (C) 2004 Novell 
8 //
9
10 using System;
11 using System.Reflection; 
12
13 using NUnit.Framework;
14
15 namespace MonoTests.System.Reflection
16 {
17         [TestFixture]
18         public class PropertyInfoTest : Assertion 
19         {
20                 [Test]
21                 public void GetAccessorsTest()
22                 {
23                         Type type = typeof(TestClass);
24                         PropertyInfo property = type.GetProperty ("ReadOnlyProperty");
25                         MethodInfo[] methods = property.GetAccessors (true);
26
27                         AssertEquals ("GetAccessors#1", 1, methods.Length);
28                         AssertNotNull ("GetAccessors#2", methods[0]);
29                                                 
30                 }
31
32
33                 private class TestClass 
34                 {
35                         public string ReadOnlyProperty 
36                         {
37                                 get { return string.Empty; }
38                         }
39                 }
40         }
41 }