Exemplo n.º 1
0
        public void LoopExceptionTest()
        {
            MarkovAlgorithm al = new MarkovAlgorithm();

            al.AddProduction("a", "aa");

            al.Execute("a");
        }
Exemplo n.º 2
0
        public void AddProductionTest()
        {
            MarkovAlgorithm algorithm = new MarkovAlgorithm();

            algorithm.AddProduction("ab", "b");

            Assert.AreEqual(algorithm.Productions.Count, 1);
        }
Exemplo n.º 3
0
        public void FinalProductionTest()
        {
            MarkovAlgorithm algorithm = new MarkovAlgorithm();

            algorithm.AddProduction("ab", "b", true);

            String returnedValue = algorithm.Execute("abcabd");

            String mustBe = "bcabd";

            Assert.AreEqual(returnedValue, mustBe);
        }
Exemplo n.º 4
0
        public void ExecuteTest()
        {
            MarkovAlgorithm algorithm = new MarkovAlgorithm();

            algorithm.AddProduction("ab", "b");
            algorithm.AddProduction("ac", "c");
            algorithm.AddProduction("aa", "a");

            String returnedValue = algorithm.Execute("bacaabaa");

            String mustBe = "bcba";

            Assert.AreEqual(returnedValue, mustBe);
        }
Exemplo n.º 5
0
        public void LoopExceptionTest()
        {
            MarkovAlgorithm al = new MarkovAlgorithm();
               al.AddProduction("a", "aa");

               al.Execute("a");
        }
Exemplo n.º 6
0
        public void FinalProductionTest()
        {
            MarkovAlgorithm algorithm = new MarkovAlgorithm();
               algorithm.AddProduction("ab", "b",true);

               String returnedValue = algorithm.Execute("abcabd");

               String mustBe = "bcabd";

               Assert.AreEqual(returnedValue, mustBe);
        }
Exemplo n.º 7
0
        public void ExecuteTest()
        {
            MarkovAlgorithm algorithm = new MarkovAlgorithm();
               algorithm.AddProduction("ab","b");
               algorithm.AddProduction("ac","c");
               algorithm.AddProduction("aa","a");

               String returnedValue = algorithm.Execute("bacaabaa");

               String mustBe = "bcba";

               Assert.AreEqual(returnedValue,mustBe);
        }
Exemplo n.º 8
0
        public void AddProductionTest()
        {
            MarkovAlgorithm algorithm = new MarkovAlgorithm();
               algorithm.AddProduction("ab","b");

               Assert.AreEqual(algorithm.Productions.Count,1);
        }