예제 #1
0
        public void Tokenise_GivenStringOfKnownCharacters_ReturnsCorrectNumberOfTokens()
        {
            var tokeniser = new BankInputTokeniser();

            var input =
@" _  _  _  _  _  _  _  _  _ 
| || || || || || || || || |
|_||_||_||_||_||_||_||_||_|";

            var tokens = tokeniser.TokeniseLine(input);

            Assert.That(tokens.Count, Is.EqualTo(9));
        }
예제 #2
0
        public void Tokenise_GivenOneKnownCharacter_ReturnsOneToken()
        {
            var tokeniser = new BankInputTokeniser();

            const string input = 
@" _ 
| |
|_|";

            var tokens = tokeniser.TokeniseLine(input);

            Assert.That(tokens.Count, Is.EqualTo(1));
        }
예제 #3
0
        public void Tokenise_GivenStringOfKnownCharacters_ReturnsCorrectNumberOfTokens()
        {
            var tokeniser = new BankInputTokeniser();

            var input =
                @" _  _  _  _  _  _  _  _  _ 
| || || || || || || || || |
|_||_||_||_||_||_||_||_||_|";

            var tokens = tokeniser.TokeniseLine(input);

            Assert.That(tokens.Count, Is.EqualTo(9));
        }
예제 #4
0
        public void Tokenise_GivenOneKnownCharacter_ReturnsOneToken()
        {
            var tokeniser = new BankInputTokeniser();

            const string input =
                @" _ 
| |
|_|";

            var tokens = tokeniser.TokeniseLine(input);

            Assert.That(tokens.Count, Is.EqualTo(1));
        }
예제 #5
0
        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("|_|"));
        }
예제 #6
0
        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("|_|"));
        }