Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public void CustomNodeInfoGetterThrowsWhenNotAvailable()
 {
     GameTreeNode node = new GameTreeNode();
     var          info = node.GetNodeInfo <TestGameTreeNodeInfo>();
 }