Exemple #1
0
 public static void Main(string[] args) {
   var bankOCR = new BankOCR();
   var TextLines = bankOCR.TextLines;
   Console.WriteLine(TextLines); 
   Console.WriteLine(bankOCR.zerothCharacter);  
   Console.ReadLine();
 }
Exemple #2
0
 public void TestingFirstOCRFileSecondLine() {
   var bankOCR = new BankOCR();
   bankOCR.ConvertingOneLineAtATime();
   List<string> textStrings = bankOCR.TextLines;
   string actualString =
     "  |  |  |  |  |  |  |  |  |";
   Assert.AreEqual(textStrings[2], actualString);
 }
Exemple #3
0
 public void TestingComparingMatrixedCharacterswithCharacterValuesInDIctionary() {
   var bankOCR = new BankOCR();
   var drawnNumberCharacters = new DrawnNumberCharacters();
   bankOCR.ConvertingOneLineAtATime();
   bankOCR.GetNthCharacter(0);
   
   Assert.AreEqual(bankOCR.zerothCharacter, drawnNumberCharacters.Numbers[1]);
 }
Exemple #4
0
 public void TestingFirstOCRFinalListTest() {
   var bankOCR = new BankOCR();
   bankOCR.ConvertingOneLineAtATime();
   List<string> textStrings = bankOCR.TextLines; 
   List<string> actualList = new List<string> {
     "                           ",
     "  |  |  |  |  |  |  |  |  |",
     "  |  |  |  |  |  |  |  |  |",
     "                           "
   };
   Assert.AreEqual(actualList, textStrings);
 }
Exemple #5
0
    public List<string> GetNthCharacter(int CharacterMatrixIndex) {
      var bankOCR = new BankOCR();
      TextLines = bankOCR.TextLines; 
     /* string result = "";
      for(int i =0; i<=3; i++) {
        result += TextLines[i].Substring(CharacterMatrixIndex * 3, lengthOfSubstring);
      }
      */
      string firstRow = TextLines[0].Substring(CharacterMatrixIndex * 3, lengthOfSubstring);
      string secondRow = TextLines[1].Substring(CharacterMatrixIndex * 3, lengthOfSubstring);
      string thirdRow = TextLines[2].Substring(CharacterMatrixIndex * 3, lengthOfSubstring);
      string fourthRow = TextLines[3].Substring(CharacterMatrixIndex * 3, lengthOfSubstring);

      MatrixedDigit.Add(firstRow);
      MatrixedDigit.Add(secondRow);
      MatrixedDigit.Add(thirdRow);
      MatrixedDigit.Add(fourthRow);

      return MatrixedDigit;
    }
Exemple #6
0
    public void GetNthCharacter_FirstCharacter() {
      var bankOCR = new BankOCR();
      var input = new List<string> {
        "111222333",
        "444555666",
        "777888999",
        "         "
      };

      var expected = new List<string> {
        "111",
        "444",
        "777",
        "   "
      };

      bankOCR.TextLines = input;
      //this works because it assigns the list of the input to the list of the TextLines
      //this is something that Lou was showing me... definitley incredibly helpful and
      //this is the reason why it passes, otherwise GetNthCharacter doesn't have anything to 
      //perform a substring off of, hence it's out of index. 
      Assert.AreEqual(expected, bankOCR.GetNthCharacter(0));
    }
Exemple #7
0
 public void TestingDictionaryMatrixCharacter() {
   var bankOCR = new BankOCR();
   var drawnNumberCharacters = new DrawnNumberCharacters();
   List<string> testForDrawnNumberOne = new List<string> {
     "   ",
     "  |",
     "  |",
     "   " };
   // bankOCR.TextLines = testForDrawnNumberOne; 
   Assert.AreEqual(testForDrawnNumberOne, drawnNumberCharacters.Numbers[1]);
 }
Exemple #8
0
    public void TestingTheComparisonBetweenTheDrawnAndTheInts() {
      var bankOCR = new BankOCR();
      var drawnNumberCharacters = new DrawnNumberCharacters();


    }
Exemple #9
0
 public void GetNthCharacter_SecondCharacter() {
   var bankOCR = new BankOCR();
   var input = new List<String> {
     "111222333",
     "444555666",
     "777888999",
     "         "
   };
   var expected = new List<String> {
     "222",
     "555",
     "888",
     "   "
   };
   bankOCR.TextLines = input;
   Assert.AreEqual(expected, bankOCR.GetNthCharacter(1));
 }
Exemple #10
0
 public void GettingInputToWork() {
   var bankOCR = new BankOCR();
   var input = new List<string> {
     "111222333",
     "444555666",
     "777888999",
     "         "
   };
   var expected = new List<string> {
     "111222333",
     "444555666",
     "777888999",
     "         "
   };
   Assert.AreEqual(expected, input);
 }