Esempio n. 1
0
        public void GivenNuGetTrustCommandItDisplaysCompletions()
        {
            var expected = new[] {
                "--algorithm",
                "--allow-untrusted-root",
                "--configfile",
                "--owners",
                "--verbosity",
                "--help",
                "-v",
                "-?",
                "-h",
                "/?",
                "/h",
                "author",
                "certificate",
                "list",
                "remove",
                "repository",
                "source",
                "sync"
            };

            var reporter = new BufferedReporter();

            CompleteCommand.RunWithReporter(new[] { "dotnet nuget trust " }, reporter).Should().Be(0);
            reporter.Lines.OrderBy(c => c).Should().Equal(expected.OrderBy(c => c));
        }
Esempio n. 2
0
        public void GivenNuGetSignCommandItDisplaysCompletions()
        {
            var expected = new[] {
                "--certificate-fingerprint",
                "--certificate-path",
                "--certificate-store-name",
                "--certificate-store-location",
                "--certificate-subject-name",
                "--certificate-password",
                "--hash-algorithm",
                "--timestamper",
                "--timestamp-hash-algorithm",
                "--verbosity",
                "--output",
                "--overwrite",
                "-o",
                "--help",
                "-v",
                "-?",
                "-h",
                "/?",
                "/h"
            };

            var reporter = new BufferedReporter();

            CompleteCommand.RunWithReporter(new[] { "dotnet nuget sign " }, reporter).Should().Be(0);
            reporter.Lines.OrderBy(c => c).Should().Equal(expected.OrderBy(c => c));
        }
Esempio n. 3
0
        public void GivenNuGetLocalsCommandItDisplaysCompletions()
        {
            var expected = new[] {
                "--clear",
                "--force-english-output",
                "--help",
                "--list",
                "-?",
                "-c",
                "-h",
                "-l",
                "/?",
                "/h",
                "all",
                "global-packages",
                "http-cache",
                "temp",
                "plugins-cache"
            };

            var reporter = new BufferedReporter();

            CompleteCommand.RunWithReporter(new[] { "dotnet nuget locals " }, reporter).Should().Be(0);
            reporter.Lines.OrderBy(c => c).Should().Equal(expected.OrderBy(c => c));
        }
Esempio n. 4
0
        public void GivenNuGetPushCommandItDisplaysCompletions()
        {
            var expected = new[] {
                "--api-key",
                "--disable-buffering",
                "--force-english-output",
                "--help",
                "--no-service-endpoint",
                "--no-symbols",
                "--skip-duplicate",
                "--source",
                "--symbol-api-key",
                "--symbol-source",
                "--timeout",
                "--interactive",
                "-?",
                "-d",
                "-h",
                "-k",
                "-n",
                "-s",
                "-sk",
                "-ss",
                "-t",
                "/?",
                "/h",
            };

            var reporter = new BufferedReporter();

            CompleteCommand.RunWithReporter(new[] { "dotnet nuget push " }, reporter).Should().Be(0);
            reporter.Lines.OrderBy(c => c).Should().Equal(expected.OrderBy(c => c));
        }
Esempio n. 5
0
        public void GivenNewCommandItDisplaysCompletions()
        {
            var expected = new[] {
                "--dry-run",
                "--force",
                "--help",
                "--install",
                "--language",
                "--list",
                "--name",
                "--nuget-source",
                "--output",
                "--type",
                "--uninstall",
                "-h",
                "-i",
                "-l",
                "-lang",
                "-n",
                "-o",
                "-u"
            };

            var reporter = new BufferedReporter();

            CompleteCommand.RunWithReporter(new[] { "dotnet new " }, reporter).Should().Be(0);
            reporter.Lines.Should().Equal(expected.OrderBy(c => c));
        }
Esempio n. 6
0
        public void GivenNewCommandItDisplaysCompletions()
        {
            var expected = new[] {
                "--columns",
                "--dry-run",
                "--force",
                "--help",
                "--install",
                "--language",
                "--list",
                "--interactive",
                "--name",
                "--nuget-source",
                "--output",
                "--type",
                "--uninstall",
                "-?",
                "-h",
                "-i",
                "-l",
                "-lang",
                "-n",
                "-o",
                "-u",
                "/?",
                "/h",
                "--update-check",
                "--update-apply"
            };

            var reporter = new BufferedReporter();

            CompleteCommand.RunWithReporter(new[] { "dotnet new " }, reporter).Should().Be(0);
            reporter.Lines.OrderBy(c => c).Should().Contain(expected.OrderBy(c => c));
        }
Esempio n. 7
0
        public void GivenDotnetAddPackWithPosition()
        {
            var expected = new[] {
                "package"
            };

            var reporter = new BufferedReporter();

            CompleteCommand.RunWithReporter(GetArguments("dotnet add pack$ abc"), reporter).Should().Be(0);
            reporter.Lines.OrderBy(c => c).Should().Equal(expected.OrderBy(c => c));
        }
Esempio n. 8
0
        public void GivenDotnetToolInWithPosition()
        {
            var expected = new[] {
                "install",
                "uninstall",
            };

            var reporter = new BufferedReporter();

            CompleteCommand.RunWithReporter(GetArguments("dotnet tool in$ abc"), reporter).Should().Be(0);
            reporter.Lines.OrderBy(c => c).Should().Equal(expected.OrderBy(c => c));
        }
Esempio n. 9
0
        public void GivenNuGetCommandItDisplaysCompletions()
        {
            var expected = new[] {
                "--help",
                "--verbosity",
                "--version",
                "-h",
                "-v",
                "delete",
                "locals",
                "push",
            };

            var reporter = new BufferedReporter();

            CompleteCommand.RunWithReporter(new[] { "dotnet nuget " }, reporter).Should().Be(0);
            reporter.Lines.Should().Equal(expected.OrderBy(c => c));
        }
Esempio n. 10
0
        public void GivenOnlyDotnetItSuggestsTopLevelCommandsAndOptions()
        {
            var expected = new[] {
                "--diagnostics",
                "--help",
                "--info",
                "--list-runtimes",
                "--list-sdks",
                "--version",
                "-?",
                "-d",
                "-h",
                "/?",
                "/h",
                "add",
                "build",
                "build-server",
                "clean",
                "format",
                "sdk",
                "fsi",
                "help",
                "list",
                "msbuild",
                "new",
                "nuget",
                "pack",
                "publish",
                "remove",
                "restore",
                "run",
                "sln",
                "store",
                "test",
                "tool",
                "vstest",
                "workload"
            };

            var reporter = new BufferedReporter();

            CompleteCommand.RunWithReporter(new[] { "dotnet " }, reporter).Should().Be(0);
            reporter.Lines.OrderBy(c => c).Should().Equal(expected.OrderBy(c => c));
        }
Esempio n. 11
0
        public void GivenNuGetVerifyCommandItDisplaysCompletions()
        {
            var expected = new[] {
                "--all",
                "--certificate-fingerprint",
                "--verbosity",
                "--help",
                "-v",
                "-?",
                "-h",
                "/?",
                "/h",
            };

            var reporter = new BufferedReporter();

            CompleteCommand.RunWithReporter(new[] { "dotnet nuget verify " }, reporter).Should().Be(0);
            reporter.Lines.OrderBy(c => c).Should().Equal(expected.OrderBy(c => c));
        }
Esempio n. 12
0
        public void GivenNuGetDeleteCommandItDisplaysCompletions()
        {
            var expected = new string[] {
                "--api-key",
                "--force-english-output",
                "--help",
                "--no-service-endpoint",
                "--non-interactive",
                "--source",
                "-h",
                "-k",
                "-s"
            };

            var reporter = new BufferedReporter();

            CompleteCommand.RunWithReporter(new[] { "dotnet nuget delete " }, reporter).Should().Be(0);
            reporter.Lines.Should().Equal(expected.OrderBy(c => c));
        }
Esempio n. 13
0
        public void GivenNewCommandItDisplaysCompletions()
        {
            var expected = new[] {
                "--help",
                "-?",
                "-h",
                "/?",
                "/h",
                "install",
                "list",
                "search",
                "uninstall",
                "update"
            };

            var reporter = new BufferedReporter();

            CompleteCommand.RunWithReporter(new[] { "dotnet new " }, reporter).Should().Be(0);
            reporter.Lines.OrderBy(c => c).Should().Contain(expected.OrderBy(c => c));
        }
Esempio n. 14
0
        public void GivenASlashItSuggestsTopLevelOptions()
        {
            var expected = new[] {
                "--diagnostics",
                "--help",
                "--info",
                "--list-runtimes",
                "--list-sdks",
                "--version",
                "-d",
                "-h",
                "build-server" // This should be removed when completion is based on "starts with" rather than "contains".
                               // See https://github.com/dotnet/cli/issues/8958.
            };

            var reporter = new BufferedReporter();

            CompleteCommand.RunWithReporter(new[] { "dotnet -" }, reporter).Should().Be(0);
            reporter.Lines.Should().Equal(expected.OrderBy(c => c));
        }