예제 #1
0
        public void TestGetActiveItem()
        {
            ActiveCollection <object> test = new ActiveCollection <object>();

            Assert.Null(test.GetActiveItem <string>());
            test.Add("a");
            Assert.AreSame(test.GetActiveItem <string>(), "a");
            test.Add("b");
            Assert.AreSame(test.GetActiveItem <string>(), "b");
            test.Add(this); // any non-string
            Assert.AreSame(test.GetActiveItem <string>(), "b");
            Assert.AreSame(test.GetActiveItem <TestActiveCollection>(), this);
        }
예제 #2
0
 public void TestGetActiveItem()
 {
     ActiveCollection<object> test = new ActiveCollection<object>();
     Assert.Null(test.GetActiveItem<string>());
     test.Add("a");
     Assert.AreSame(test.GetActiveItem<string>(), "a");
     test.Add("b");
     Assert.AreSame(test.GetActiveItem<string>(), "b");
     test.Add(this); // any non-string
     Assert.AreSame(test.GetActiveItem<string>(), "b");
     Assert.AreSame(test.GetActiveItem<TestActiveCollection>(), this);
 }