public void TestValidAutomataSingleNodeIsTrue() { BooleanNetworkValidator validator = new BooleanNetworkValidator(); var automata = new GeneNode() { NodeName = "a", }; var booleanNetwork = new List <GeneLink>() { new GeneLink() { From = "A", To = "B", IsPositive = true }, new GeneLink() { From = "A", To = "C", IsPositive = true } } ; var res = validator.IsValidAutomata(automata, null, booleanNetwork); Assert.IsTrue(res); }
public void TestValidAutomataWithLoop() { BooleanNetworkValidator validator = new BooleanNetworkValidator(); var automata = new GeneNode() { NodeName = "a", Transitions = new List <GeneTransition>() { new GeneTransition() { Condition = new Condition() { { "A", true }, { "B", true }, { "C", true } }, Node = new GeneNode() { NodeName = "b", Transitions = new List <GeneTransition>() { new GeneTransition() { Condition = new Condition() { { "A", true }, { "B", true }, { "C", true } }, Node = null } } } } } }; // set the loop automata.Transitions.First().Node = automata; var booleanNetwork = new List <GeneLink>() { new GeneLink() { From = "A", To = "B", IsPositive = true }, new GeneLink() { From = "A", To = "C", IsPositive = true } } ; var res = validator.IsValidAutomata(automata, null, booleanNetwork); Assert.IsTrue(res); }
public void TestValidAutomataSimplePathIsTrue() { BooleanNetworkValidator validator = new BooleanNetworkValidator(); var automata = new GeneNode() { NodeName = "a", Transitions = new List <GeneTransition>() { new GeneTransition() { Condition = new Condition() { { "A", true }, { "B", false }, { "C", false } }, Node = new GeneNode() { NodeName = "b", Transitions = new List <GeneTransition>() { new GeneTransition() { Condition = new Condition() { { "A", true }, { "B", true }, { "C", true } }, Node = new GeneNode() { NodeName = "final" } } } } } } }; var booleanNetwork = new List <GeneLink>() { new GeneLink() { From = "A", To = "B", IsPositive = true }, new GeneLink() { From = "A", To = "C", IsPositive = true } } ; var res = validator.IsValidAutomata(automata, null, booleanNetwork); Assert.IsTrue(res); }