コード例 #1
0
            public void ReturnsScriptPacks()
            {
                // act
                var cmd = new ScriptPacksCommand(new Mock<IConsole>().Object);

                // assert
                Assert.Equal("scriptpacks", cmd.CommandName);
            }
コード例 #2
0
            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"));
            }
コード例 #3
0
            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; }"));
            }
コード例 #4
0
            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; }"));
            }
コード例 #5
0
            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()"));
            }