コード例 #1
0
        public void EvaluateAll_Test2()
        {
            IDataReader      dataReader = new TextFileDataReader(TestFilePath2);
            IStringEvaluator eval       = new PalindromeEvaluator(dataReader);

            Assert.AreEqual(20, eval.EvaluateAll());
        }
コード例 #2
0
        public ActionResult Palindromes(PalindromeTool pt)
        {
            if (ModelState.IsValid)
            {
                var request   = new PalindromeRequest();
                var evaluator = new PalindromeEvaluator();
                request.RawString = pt.RawString;
                request           = evaluator.EvaluatePalindrome(request);
                if (request.IsPalindrome)
                {
                    pt.IsPalindrome = 1;
                }
                else
                {
                    pt.IsPalindrome = 2;
                }

                return(View("Palindromes", pt));
            }
            return(View("Palindromes"));
        }
コード例 #3
0
 public PalindromeEvaluatorTest()
 {
     _dataReader = new TextFileDataReader(TestFilePath1);
     _eval       = new PalindromeEvaluator(_dataReader);
 }