public void NodeInfoCanBeStored() { GameTreeNode node = new GameTreeNode(); var info = new TestGameTreeNodeInfo("custom"); node.SetNodeInfo(info); var retrievedInfo = node.GetNodeInfo <TestGameTreeNodeInfo>(); Assert.IsNotNull(retrievedInfo); Assert.AreEqual("custom", retrievedInfo.TestInfo); }
public void NewerSetOverwritesPreviousNodeInfo() { GameTreeNode node = new GameTreeNode(); var originalInfo = new TestGameTreeNodeInfo("original"); var updatedInfo = new TestGameTreeNodeInfo("new"); node.SetNodeInfo(originalInfo); node.SetNodeInfo(updatedInfo); var retrievedInfo = node.GetNodeInfo <TestGameTreeNodeInfo>(); Assert.IsNotNull(retrievedInfo); Assert.AreEqual("new", retrievedInfo.TestInfo); }
public void CustomNodeInfoGetterThrowsWhenNotAvailable() { GameTreeNode node = new GameTreeNode(); var info = node.GetNodeInfo <TestGameTreeNodeInfo>(); }