Beispiel #1
0
        public void GetTargetCommandSchema_Negative_Test(IReadOnlyList <CommandSchema> availableCommandSchemas, CommandInput commandInput)
        {
            // Arrange
            var resolver = new CommandSchemaResolver(new CommandArgumentSchemasValidator());

            // Act
            var commandCandidate = resolver.GetTargetCommandSchema(availableCommandSchemas, commandInput);

            // Assert
            commandCandidate.Should().BeNull();
        }
Beispiel #2
0
        public void GetTargetCommandSchema_Positive_Test(IReadOnlyList <CommandSchema> availableCommandSchemas,
                                                         CommandInput commandInput,
                                                         IReadOnlyList <string> expectedPositionalArguments,
                                                         string expectedCommandSchemaName)
        {
            // Arrange
            var resolver = new CommandSchemaResolver(new CommandArgumentSchemasValidator());

            // Act
            var commandCandidate = resolver.GetTargetCommandSchema(availableCommandSchemas, commandInput);

            // Assert
            commandCandidate.Should().NotBeNull();
            commandCandidate.PositionalArgumentsInput.Should().BeEquivalentTo(expectedPositionalArguments);
            commandCandidate.Schema.Name.Should().Be(expectedCommandSchemaName);
        }