public void GetOutPutString_Add_AtTheBegining() { Dictionary <double, Alphabet> list = new Dictionary <double, Alphabet>(); string input = "fed"; string expectedInitial = "def"; IAlphabetMachine machine = new AlphabetMachine(input); Assert.Equal(expectedInitial, machine.GetOutPutString()); // now add ab&c string expected = "abcdef"; machine.AddAlphabet(new Alphabet('c')); machine.AddAlphabet(new Alphabet('a')); machine.AddAlphabet(new Alphabet('b')); string actual = machine.GetOutPutString(); Assert.Equal(expected, actual); }
public void GetOutPutString_Add_ToTheEnd() { Dictionary <double, Alphabet> list = new Dictionary <double, Alphabet>(); string input = "xy"; string expectedInitial = "xy"; IAlphabetMachine machine = new AlphabetMachine(input); Assert.Equal(expectedInitial, machine.GetOutPutString()); // now add ab&c string expected = "xyz"; machine.AddAlphabet(new Alphabet('z')); string actual = machine.GetOutPutString(); Assert.Equal(expected, actual); }
public void GetOutPutString_AddRandomly_DisplayInOrder() { string expected = "abcde"; IAlphabetMachine machine = new AlphabetMachine(); machine.AddAlphabet(new Alphabet('b')); machine.AddAlphabet(new Alphabet('c')); machine.AddAlphabet(new Alphabet('d')); machine.AddAlphabet(new Alphabet('e')); machine.AddAlphabet(new Alphabet('a')); string actual = machine.GetOutPutString(); Assert.Equal(expected, actual); }