示例#1
0
        public async Task Register_command_adds_new_suggestion_entry()
        {
            var provider   = new TestSuggestionRegistration();
            var dispatcher = new SuggestionDispatcher(provider);

            var args = CommandLineStringSplitter.Instance.Split($"register --command-path \"{_netExeFullPath}\" --suggestion-command \"net-suggestions complete\"").ToArray();

            await dispatcher.InvokeAsync(args);

            Registration addedRegistration = provider.FindAllRegistrations().Single();

            addedRegistration.ExecutablePath.Should().Be(_netExeFullPath);
        }
示例#2
0
        public async Task Register_command_will_not_add_duplicate_entry()
        {
            var provider   = new TestSuggestionRegistration();
            var dispatcher = new SuggestionDispatcher(provider);

            var args = CommandLineStringSplitter.Instance.Split($"register --command-path \"{_netExeFullPath}\" --suggestion-command \"net-suggestions complete\"").ToArray();

            await dispatcher.InvokeAsync(args);

            await dispatcher.InvokeAsync(args);

            provider.FindAllRegistrations().Should().HaveCount(1);
        }
        public async Task Register_command_adds_new_suggestion_entry()
        {
            var provider   = new TestSuggestionRegistration();
            var dispatcher = new SuggestionDispatcher(provider);

            var args = $"register --command-path \"{_netExeFullPath}\" --suggestion-command \"net-suggestions complete\"".Tokenize().ToArray();

            await dispatcher.InvokeAsync(args);

            RegistrationPair addedRegistration = provider.FindAllRegistrations().Single();

            addedRegistration.CommandPath.Should().Be(_netExeFullPath);
            addedRegistration.SuggestionCommand.Should().Be("net-suggestions complete");
        }