1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using NUnit.Framework;
6 
7 namespace Test_NUnit.Internals
8 {
9     [TestFixture]
10     public class ReflectionTest
11     {
12         //there was a bug where intField1 would be listed multiple times in a select statement:
13         public class Class1
14         {
15             protected int intField1;
16             public int publicField;
17         }
18         public class Class2 : Class1
19         {
20             protected int intField2;
21         }
22 #if OBSOLETE
23         [Test]
AttribHelper_NoDuplicateFields()24         public void AttribHelper_NoDuplicateFields()
25         {
26             //Andrus pointed out that one of the internal classes that help with reflection
27             //returns fields in duplicate, which kills SQL SELECT and UPDATEs.
28             System.Reflection.MemberInfo[] members = DbLinq.Util.AttribHelper.GetMemberFields(typeof(Class2));
29             Assert.IsTrue(members.Length == 3);
30         }
31 
32         [Test]
AttribHelper_IncludePublicFields()33         public void AttribHelper_IncludePublicFields()
34         {
35             //Andrus pointed out that one of the internal classes that help with reflection
36             //returns fields in duplicate, which kills SQL SELECT and UPDATEs.
37             System.Reflection.MemberInfo[] members = DbLinq.Util.AttribHelper.GetMemberFields(typeof(Class1));
38             Assert.IsTrue(members.Length == 2);
39         }
40 #endif
41 
42     }
43 }
44