Ejemplo n.º 1
0
        public void ParseCapabilities_WithExtendedInput()
        {
            const string input = "(A(1)B(2 3(4(5 6(7)))))";


            var displayCapability = CapabilitiesParser.ParseCapabilities(input);

            displayCapability.Count.Should().Be(2);

            displayCapability[0].Name.Should().Be("A");
            displayCapability[0].Tags.Count.Should().Be(1);
            displayCapability[0].Tags[0].Name.Should().Be("1");

            displayCapability[1].Name.Should().Be("B");
            displayCapability[1].Tags.Count.Should().Be(2);
            displayCapability[1].Tags[0].Name.Should().Be("2");
            displayCapability[1].Tags[1].Name.Should().Be("3");
            displayCapability[1].Tags[1].Tags.Count.Should().Be(1);

            displayCapability[1].Tags[1].Tags[0].Name.Should().Be("4");
            displayCapability[1].Tags[1].Tags[0].Tags.Count.Should().Be(2);

            displayCapability[1].Tags[1].Tags[0].Tags[0].Name.Should().Be("5");
            displayCapability[1].Tags[1].Tags[0].Tags[0].Tags.Count.Should().Be(0);

            displayCapability[1].Tags[1].Tags[0].Tags[1].Name.Should().Be("6");
            displayCapability[1].Tags[1].Tags[0].Tags[1].Tags.Count.Should().Be(1);

            displayCapability[1].Tags[1].Tags[0].Tags[1].Tags[0].Name.Should().Be("7");
            displayCapability[1].Tags[1].Tags[0].Tags[1].Tags[0].Tags.Count
            .Should().Be(0);
        }
Ejemplo n.º 2
0
        public void ParseCapabilities_HandlesMultipleWhitespaces(string input)
        {
            var displayCapability = CapabilitiesParser.ParseCapabilities(input);

            displayCapability.Count.Should().Be(1);

            displayCapability[0].Name.Should().Be("B");
            displayCapability[0].Tags.Count.Should().Be(2);
            displayCapability[0].Tags[0].Name.Should().Be("2");
            displayCapability[0].Tags[1].Name.Should().Be("3");
        }
Ejemplo n.º 3
0
        public void Handles_Whitespace_Before_Closing_Bracket()
        {
            const string input = "(A(1 2 ))";

            var displayCapability = CapabilitiesParser.ParseCapabilities(input);

            displayCapability.Count.Should().Be(1);
            displayCapability.First().Tags.Count.Should().Be(2);
            displayCapability.First().Tags[0].Name.Should().Be("1");
            displayCapability.First().Tags[1].Name.Should().Be("2");
        }
Ejemplo n.º 4
0
        public void ParseCapabilities_WithBasicInput()
        {
            const string input = "(A(1)B(2))";


            var displayCapability = CapabilitiesParser.ParseCapabilities(input);

            displayCapability.Count.Should().Be(2);

            displayCapability[0].Name.Should().Be("A");
            displayCapability[0].Tags.Count.Should().Be(1);
            displayCapability[0].Tags[0].Name.Should().Be("1");

            displayCapability[1].Name.Should().Be("B");
            displayCapability[1].Tags.Count.Should().Be(1);
            displayCapability[1].Tags[0].Name.Should().Be("2");
        }
Ejemplo n.º 5
0
        public void ParseCapabilities_Returns_Empty_List_On_Empty_Input2(string input)
        {
            var displayCapability = CapabilitiesParser.ParseCapabilities(input);

            displayCapability.Should().BeEmpty();
        }