public async Task TrustedSignersCommand_SendsArgumentsCorrectlyToCommandRunnerAsync()
        {
            var commandRunner = new Mock <ITrustedSignersCommandRunner>();
            var mockConsole   = new Mock <IConsole>();

            var expectedName                   = "signerName";
            var expectedServiceIndex           = @"https://serviceIndex.test";
            var expectedCertificateFingerprint = "abcdefg";
            var expectedFingerprintAlgorithm   = "SHA256";
            var expectedAllowUntrustedRoot     = true;
            var expectedAuthor                 = true;
            var expectedRepository             = true;
            var expectedAction                 = TrustedSignersAction.Add;
            var expectedOwners                 = new List <string>()
            {
                "one", "two", "three"
            };
            var expectedPackagePath = @"C:\\package\\path\\test";

            var command = new TrustedSignersCommand()
            {
                TrustedSignersCommandRunner = commandRunner.Object,
                Name                   = expectedName,
                ServiceIndex           = expectedServiceIndex,
                CertificateFingerprint = expectedCertificateFingerprint,
                FingerprintAlgorithm   = expectedFingerprintAlgorithm,
                AllowUntrustedRoot     = expectedAllowUntrustedRoot,
                Author                 = expectedAuthor,
                Repository             = expectedRepository,
                Owners                 = expectedOwners,
                Console                = mockConsole.Object
            };

            command.Arguments.Add(expectedAction.ToString());
            command.Arguments.Add(expectedPackagePath);

            // Act
            command.Execute();
            await command.ExecuteCommandAsync();

            commandRunner.Verify(r =>
                                 r.ExecuteCommandAsync(It.Is <TrustedSignersArgs>(a =>
                                                                                  a.Action == expectedAction &&
                                                                                  string.Equals(a.Name, expectedName, StringComparison.Ordinal) &&
                                                                                  string.Equals(a.ServiceIndex, expectedServiceIndex, StringComparison.OrdinalIgnoreCase) &&
                                                                                  string.Equals(a.CertificateFingerprint, expectedCertificateFingerprint, StringComparison.Ordinal) &&
                                                                                  string.Equals(a.FingerprintAlgorithm, expectedFingerprintAlgorithm, StringComparison.Ordinal) &&
                                                                                  a.AllowUntrustedRoot == expectedAllowUntrustedRoot &&
                                                                                  a.Author == expectedAuthor &&
                                                                                  a.Repository == expectedRepository &&
                                                                                  a.Owners.SequenceEqual(expectedOwners) &&
                                                                                  string.Equals(a.PackagePath, expectedPackagePath, StringComparison.Ordinal))));
        }
        public async Task TrustedSignersCommand_NoAction_DefaultsToListAsync()
        {
            var commandRunner = new Mock <ITrustedSignersCommandRunner>();
            var mockConsole   = new Mock <IConsole>();

            var command = new TrustedSignersCommand()
            {
                TrustedSignersCommandRunner = commandRunner.Object,
                Console = mockConsole.Object
            };

            // Act
            command.Execute();
            await command.ExecuteCommandAsync();

            commandRunner.Verify(r => r.ExecuteCommandAsync(It.Is <TrustedSignersArgs>(a => a.Action == TrustedSignersAction.List)));
        }