public void TestLookupCount() { IBlackboard blackboard = new Blackboard(); TestUnit1 u1 = new TestUnit1("one"); TestUnit1 u2 = new TestUnit1("two"); TestUnit1 u3 = new TestUnit1("three"); TestUnit2 u4 = new TestUnit2(1); TestUnit2 u5 = new TestUnit2(2); string type1 = u1.GetType().FullName; string type2 = u4.GetType().FullName; blackboard.AddUnit(u1); blackboard.AddUnit(u2); blackboard.AddUnit(u3); blackboard.AddUnit(u4); blackboard.AddUnit(u5); ISet <IUnit> set1 = blackboard.LookupUnits(type1); ISet <IUnit> set2 = blackboard.LookupUnits(type2); Assert.Equal(3, set1.Count); Assert.Equal(2, set2.Count); }
public void TestLookupNotNull() { IBlackboard blackboard = new Blackboard(); TestUnit1 u1 = new TestUnit1("one"); TestUnit2 u2 = new TestUnit2(1); string type1 = u1.GetType().FullName; string type2 = u2.GetType().FullName; blackboard.AddUnit(u1); blackboard.AddUnit(u2); Assert.NotNull(blackboard.LookupUnits(type1)); Assert.NotNull(blackboard.LookupUnits(type2)); }