Beispiel #1
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);
        }
Beispiel #2
0
        public void LoopExceptionTest()
        {
            MarkovAlgorithm al = new MarkovAlgorithm();

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

            al.Execute("a");
        }
Beispiel #3
0
        public void AddProductionTest()
        {
            MarkovAlgorithm algorithm = new MarkovAlgorithm();

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

            Assert.AreEqual(algorithm.Productions.Count, 1);
        }
Beispiel #4
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);
        }
Beispiel #5
0
        public void LoopExceptionTest()
        {
            MarkovAlgorithm al = new MarkovAlgorithm();
               al.AddProduction("a", "aa");

               al.Execute("a");
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #8
0
        public void AddProductionTest()
        {
            MarkovAlgorithm algorithm = new MarkovAlgorithm();
               algorithm.AddProduction("ab","b");

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