public void ReturnsScriptPacks() { // act var cmd = new ScriptPacksCommand(new Mock<IConsole>().Object); // assert Assert.Equal("scriptpacks", cmd.CommandName); }
public void ShouldExitIfThereAreNoScriptPacks() { _scriptPackSession.Setup(x => x.Contexts).Returns((IEnumerable<IScriptPackContext>)null); var cmd = new ScriptPacksCommand(_console.Object); cmd.Execute(_repl.Object, null); _console.Verify(x => x.WriteLine("There are no script packs available in this REPL session")); }
public void ShouldRespectNamespaces() { _repl.Setup(x => x.Namespaces).Returns(new Collection<string> { "ScriptCs.Tests.ReplCommands" }); var cmd = new ScriptPacksCommand(_console.Object); cmd.Execute(_repl.Object, null); _console.Verify(x => x.WriteLine(" - DummyScriptPack Something()")); _console.Verify(x => x.WriteLine(" - DummyScriptPack Xyz { get; }")); }
public void ShouldPrintPropertyInformation() { var cmd = new ScriptPacksCommand(_console.Object); cmd.Execute(_repl.Object, null); _console.Verify(x => x.WriteLine(typeof(DummyScriptPack).FullName.ToString())); _console.Verify(x => x.WriteLine("** Properties **")); _console.Verify(x => x.WriteLine(" - double FooBar { get; set; }")); _console.Verify(x => x.WriteLine(" - ScriptCs.Tests.ReplCommands.DummyScriptPack Xyz { get; }")); }
public void ShouldPrintMethodSignatures() { var cmd = new ScriptPacksCommand(_console.Object); cmd.Execute(_repl.Object, null); _console.Verify(x => x.WriteLine(typeof(DummyScriptPack).FullName.ToString())); _console.Verify(x => x.WriteLine("** Methods **")); _console.Verify(x => x.WriteLine(" - string Foo(int bar)")); _console.Verify(x => x.WriteLine(" - ScriptCs.Tests.ReplCommands.DummyScriptPack Something()")); }