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); }
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); }