Exemplo n.º 1
0
            public void ShouldReturnFalseOtherwise(IFileParser parser, UsingLineProcessor processor)
            {
                // Arrange
                const string UsingLine = @"using (var x = new Disposable())";

                // Act
                var result = processor.ProcessLine(parser, new FileParserContext(), UsingLine, true);

                // Assert
                result.ShouldBeFalse();
            }
Exemplo n.º 2
0
            public void ShouldIgnoreAliases(IFileParser parser, UsingLineProcessor processor)
            {
                // Arrange
                const string UsingLine = "using Path = System.IO.Path";

                // Act
                var result = processor.ProcessLine(parser, new FileParserContext(), UsingLine, true);

                // Assert
                result.ShouldBeFalse();
            }
Exemplo n.º 3
0
            public void ShouldReturnTrueOnUsingLine(IFileParser parser, UsingLineProcessor processor)
            {
                // Arrange
                const string UsingLine = "using System.Data;";

                // Act
                var result = processor.ProcessLine(parser, new FileParserContext(), UsingLine, true);

                // Assert
                result.ShouldBeTrue();
            }
Exemplo n.º 4
0
            public void ShouldReturnFalseOtherwise(IFileParser parser, UsingLineProcessor processor)
            {
                // Arrange
                const string UsingLine = @"using (var x = new Disposable())";

                // Act
                var result = processor.ProcessLine(parser, new FileParserContext(), UsingLine, true);

                // Assert
                result.ShouldBeFalse();
            }
Exemplo n.º 5
0
            public void ShouldReturnTrueOnUsingLine(IFileParser parser, UsingLineProcessor processor)
            {
                // Arrange
                const string UsingLine = @"using ""System.Data"";";

                // Act
                var result = processor.ProcessLine(parser, new FileParserContext(), UsingLine, true);

                // Assert
                result.ShouldBeTrue();
            }
Exemplo n.º 6
0
            public void ShouldIgnoreAliases(IFileParser parser, UsingLineProcessor processor)
            {
                // Arrange
                const string UsingLine = @"using Path = ""System.IO.Path"";";

                // Act
                var result = processor.ProcessLine(parser, new FileParserContext(), UsingLine, true);

                // Assert
                result.ShouldBeFalse();
            }
Exemplo n.º 7
0
            public void ShouldAddNamespaceToContext(IFileParser parser, UsingLineProcessor processor)
            {
                // Arrange
                const string UsingLine = "using System.Data;";
                var          context   = new FileParserContext();

                // Act
                processor.ProcessLine(parser, context, UsingLine, true);

                // Assert
                context.Namespaces.Count.ShouldEqual(1);
            }
Exemplo n.º 8
0
            public void ShouldIgnoreUsingStatic(IFileParser parser, UsingLineProcessor processor)
            {
                // Arrange
                const string UsingLine = "using static System.Console;";
                var          context   = new FileParserContext();

                // Act
                var result = processor.ProcessLine(parser, new FileParserContext(), UsingLine, true);

                // Assert
                result.ShouldBeFalse();
            }
Exemplo n.º 9
0
            public void ShouldAddNamespaceToContext(IFileParser parser, UsingLineProcessor processor)
            {
                // Arrange
                const string UsingLine = @"using ""System.Data"";";
                var context = new FileParserContext();

                // Act
                processor.ProcessLine(parser, context, UsingLine, true);

                // Assert
                context.Namespaces.Count.ShouldEqual(1);
            }