public void RemoveTest() { var lstCommands = CommandMgr.GetCommands(); Assert.AreEqual(2, lstCommands.Count, "Error, cleaned CommandMgr"); TestContext.WriteLine($"List.Count After = {lstCommands.Count}"); CommandMgr.RemoveCommand(new Command { Name = "test1" }); CommandMgr.RemoveCommand(new Command { Name = "test2" }); Assert.AreEqual(0, CommandMgr.GetCommands().Count, "Error removing commands"); TestContext.WriteLine($"List.Count Before = {CommandMgr.GetCommands().Count}"); }
public void AddTest() { //Clean the files if (File.Exists(XMLTest.XMLPATH)) { File.Delete(XMLTest.XMLPATH); } CommandMgr.Load(XMLTest.XMLPATH); CommandMgr.AddCommand(new Command { Name = "test1", Path = "test1.exe" }); CommandMgr.AddCommand(new Command { Name = "test2", Path = "test2.exe" }); Assert.AreEqual(2, CommandMgr.GetCommands().Count, "Error adding commands"); TestContext.WriteLine($"List.Count Before = {CommandMgr.GetCommands().Count}"); }