public void Tokenise_GivenStringOfKnownCharacters_ReturnsCorrectNumberOfTokens() { var tokeniser = new BankInputTokeniser(); var input = @" _ _ _ _ _ _ _ _ _ | || || || || || || || || | |_||_||_||_||_||_||_||_||_|"; var tokens = tokeniser.TokeniseLine(input); Assert.That(tokens.Count, Is.EqualTo(9)); }
public void Tokenise_GivenOneKnownCharacter_ReturnsOneToken() { var tokeniser = new BankInputTokeniser(); const string input = @" _ | | |_|"; var tokens = tokeniser.TokeniseLine(input); Assert.That(tokens.Count, Is.EqualTo(1)); }
public void Tokenise_GivenOneKnownCharacter_TokenReturnedContainsCorrectRawData() { var tokeniser = new BankInputTokeniser(); const string input = @" _ | | |_|"; var tokens = tokeniser.TokeniseLine(input); Assert.That(tokens[0].Raw[0], Is.EqualTo(" _ ")); Assert.That(tokens[0].Raw[1], Is.EqualTo("| |")); Assert.That(tokens[0].Raw[2], Is.EqualTo("|_|")); }