Exemplo n.º 1
0
        public void TestValidNoad()
        {
            IDataSource      dataSource = new DataSource.DataSource(BuildStaticDoughnutTree());
            INode            node       = DeepCopier.Copy(dataSource.DecisionTree);
            IDecisionService service    = new DecisionService(dataSource);

            Assert.True(JsonConvert.SerializeObject(node.LeafY).Equals(JsonConvert.SerializeObject(service.GetClildTree(new List <bool> {
                true
            }))));
            Assert.True(JsonConvert.SerializeObject(node.LeafY.LeafY).Equals(JsonConvert.SerializeObject(service.GetClildTree(new List <bool> {
                true, true
            }))));
            Assert.True(JsonConvert.SerializeObject(node.LeafY.LeafY.LeafY).Equals(JsonConvert.SerializeObject(service.GetClildTree(new List <bool> {
                true, true, true
            }))));
            Assert.True(JsonConvert.SerializeObject(node.LeafN).Equals(JsonConvert.SerializeObject(service.GetClildTree(new List <bool> {
                false
            }))));
        }