public void CommandLineTest() { DataHandler datahandler = new DataHandler(); //.Instance; CommandHandler commandHandler = new CommandHandler(); commandHandler.HandleCommand("Neil -> Post 1", datahandler); commandHandler.HandleCommand("Neil -> Post 2", datahandler); commandHandler.HandleCommand("Jai -> Post 1", datahandler); commandHandler.HandleCommand("Neil -> Post 3", datahandler); commandHandler.HandleCommand("Ramone -> Post 1", datahandler); commandHandler.HandleCommand("Neil -> Post 4", datahandler); commandHandler.HandleCommand("Neil follows Jai", datahandler); commandHandler.HandleCommand("Jai -> Post 2", datahandler); commandHandler.HandleCommand("Neil -> Post 5", datahandler); commandHandler.HandleCommand("Neil -> Post 6", datahandler); Assert.IsTrue(datahandler.Read("Neil").Count == 6); Assert.IsTrue(datahandler.BuildWall("Neil").Count == 8); datahandler.Dispose(); }
static void Main(string[] args) { DataHandler dataHandler = new DataHandler(); //.Instance; CommandHandler trendFeed = new CommandHandler(); bool quit = false; trendFeed.Instructions(); string trendCommand =""; while (!quit) { trendCommand = Console.ReadLine().ToString(); trendFeed.HandleCommand(trendCommand, dataHandler); } }