public void ProcessCommand_Scriptcs_OutputIsReturnAsString() { // Arrange Mock<ITransport> transportMock = new Mock<ITransport>(); transportMock.SetupGet(transport => transport.Trigger).Returns("@bot"); Bot bot = new Bot(transportMock.Object, _log); bot.Initialize(typeof(ScriptBot.Plugins.ScriptCs.ScriptBotScriptCsCommand)); // Act string results = bot.HandleCommand(@"scriptcs helloworld.csx"); // Assert Assert.IsFalse(string.IsNullOrWhiteSpace(results)); }
public void ProcessCommand_ScriptcsFileNotFound_ReturnsCouldntFindScriptcsFile() { // Arrange Mock<ITransport> transportMock = new Mock<ITransport>(); transportMock.SetupGet(transport => transport.Trigger).Returns("@bot"); Bot bot = new Bot(transportMock.Object, _log); bot.Initialize(typeof(ScriptBot.Plugins.ScriptCs.ScriptBotScriptCsCommand)); // Act string results = bot.HandleCommand(@"scriptcs random.csx"); // Assert Assert.IsTrue(results.Equals("Sorry couldn't find the scriptcs file random.csx.\r\n", StringComparison.OrdinalIgnoreCase)); }