using System; namespace CSharpUnitTesting { class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); // Create WordList WordList words = new WordList(); string word; words.AddWord("Apple"); words.AddWord("Dog"); words.AddWord("Bat"); words.AddWord("Hat"); words.AddWord("Boat"); // Get a word at index 0 word = words.GetWord(0); if (word != "") { Console.WriteLine("Found word {0}", word); } // Get last word added if(words.GetLastWord(out word)) { Console.WriteLine("Last word added was {0}", word); } // Does list contain the word we want? if (words.ContainsWord("Boat")) { Console.WriteLine("List contains the word Boat"); } // Get index of word int index; index = words.GetWordIndex("Dog"); if (index > -1) { Console.WriteLine("Index of the word Dog is {0}", index); } // Remove a word from the list if (words.RemoveWord("Dog")) { Console.WriteLine("The word Dog has been removed from the list"); } // The word at index 0 has been removed from the list if (words.RemoveWordAt(0)) { Console.WriteLine("A word has been removed from the list at index=0"); } Console.WriteLine("Output the words from the list"); index = 0; while ((word = words.GetWord(index)) != "") { Console.WriteLine(word); index++; } Console.ReadKey(); // Pause } } }