public void TestSyncRoot()
{
SetUp();
+#if !NET_2_0 // umm, why on earth do you expect SyncRoot is the Queue itself?
AssertEquals("SyncRoot q1", q1, q1.SyncRoot);
AssertEquals("SyncRoot q2", q2, q2.SyncRoot);
AssertEquals("SyncRoot emptyQueue", emptyQueue, emptyQueue.SyncRoot);
+#endif
Queue q1sync = Queue.Synchronized(q1);
AssertEquals("SyncRoot value of a synchronized queue", q1, q1sync.SyncRoot);
public void TestConstructor1() {
SortedList temp1 = new SortedList();
AssertNotNull("sl.constructor-1: returns null", temp1);
+#if !NET_2_0 // no such expectation as it is broken in .NET 2.0
AssertEquals("sl.constructor-1: incorrect initial capacity", icap, temp1.Capacity);
+#endif
}
[Test]
Comparer c = Comparer.Default;
SortedList temp1 = new SortedList(c);
AssertNotNull("sl.constructor-2: returns null", temp1);
+#if !NET_2_0 // no such expectation as it is broken in .NET 2.0
AssertEquals("sl.constructor-2: incorrect initial capacity", icap, temp1.Capacity);
+#endif
}
[Test]
} catch (ArgumentOutOfRangeException) {}
}
+#if !NET_2_0 // no such expectation as it is broken in .NET 2.0
[Test]
public void Constructor_Capacity ()
{
AssertEquals ("Capacity-Resetted" + i.ToString (), 16, sl.Capacity);
}
}
+#endif
[Test]
public void TestIsSynchronized() {
SortedList list = new SortedList (42);
AssertEquals ("42", 42, list.Capacity);
list.Capacity = 0;
+#if !NET_2_0 // no such expectation as it is broken in .NET 2.0
AssertEquals ("0(16)", 16, list.Capacity);
+#endif
}
[Test]
AssertEquals("sl.Clear: should have one element", 2, sl1.Count);
sl1.Clear();
AssertEquals("sl.Clear: is not cleared", 0, sl1.Count);
+#if !NET_2_0 // no such expectation as it is broken in .NET 2.0
AssertEquals("sl.Clear: capacity is altered", 16, sl1.Capacity);
+#endif
}
+#if !NET_2_0 // no such expectation as it is broken in .NET 2.0
[Test]
public void Clear_Capacity ()
{
AssertEquals ("Capacity", 16, sl.Capacity);
// note: we didn't return to 0 - so Clear cahnge the default capacity
}
+#endif
[Test]
public void TestClone() {
SortedList sl1 = new SortedList(24);
sl1.TrimToSize();
+#if !NET_2_0 // no such expectation as it is broken in .NET 2.0
AssertEquals("sl.TrimToSize: incorrect capacity after trimming empty list",icap,sl1.Capacity);
+#endif
for (int i = 72; i>=0; i--) sl1.Add(100+i,i);
sl1.TrimToSize();
+#if !NET_2_0 // no such expectation as it is broken in .NET 2.0
AssertEquals("sl.TrimToSize: incorrect capacity after trimming a list",73,sl1.Capacity);
+#endif
}
[Test]