Beispiel #1
0
        public void Method_with_variable_number_of_params_does_not_trigger_diagnostic()
        {
            const string testCodeSnippet = @"
                namespace Frobnitz`
                {
                    class Wombat
                    {
                        void Gork(int line, int column, params string[] diagnosticMessages) {}
                        void Bork()
                        {
                            Gork(9000, 1, ""Goku"");
                        }
                    }
                }
            ";

            Expect.EmptyDiagnosticsFor(testCodeSnippet);
        }
Beispiel #2
0
        public void Method_with_different_type_params_invoked_with_positional_args_does_not_trigger_diagnostic()
        {
            const string testCodeSnippet = @"
                namespace Frobnitz
                {
                    class Wombat
                    {
                        void Gork(string name, int powerLevel) {}
                        void Bork()
                        {
                            Gork(""Goku"", 9001);
                        }
                    }
                }
            ";

            Expect.EmptyDiagnosticsFor(testCodeSnippet);
        }
Beispiel #3
0
        public void Method_with_one_param_does_not_trigger_diagnostic()
        {
            const string testCodeSnippet = @"
                namespace Frobnitz
                {
                    class Wombat
                    {
                        void Gork(int powerLevel) {}
                        void Bork()
                        {
                            Gork(9001);
                        }
                    }
                }
            ";

            Expect.EmptyDiagnosticsFor(testCodeSnippet);
        }
Beispiel #4
0
        public void Method_with_zero_args_does_not_trigger_diagnostic()
        {
            const string testCodeSnippet = @"
                namespace Frobnitz
                {
                    class Wombat
                    {
                        void Gork() {}
                        void Bork()
                        {
                            Gork();
                        }
                    }
                }
            ";

            Expect.EmptyDiagnosticsFor(testCodeSnippet);
        }
Beispiel #5
0
        public void Method_with_same_type_params_invoked_with_named_args_starting_from_same_type_params_does_not_trigger_diagnostic()
        {
            const string testCodeSnippet = @"
                namespace Frobnitz
                {
                    class Wombat
                    {
                        void Gork(string fileName, int line, int column) {}
                        void Bork()
                        {
                            Gork(""Gizmo.cs"", line: 9000, column: 1);
                        }
                    }
                }
            ";

            Expect.EmptyDiagnosticsFor(testCodeSnippet);
        }
Beispiel #6
0
        public void Method_with_same_type_params_invoked_with_vars_named_same_as_args_does_not_trigger_diagnostic()
        {
            const string testCodeSnippet = @"
                namespace Frobnitz
                {
                    class Wombat
                    {
                        void Gork(string fileName, int line, int column) {}
                        void Bork()
                        {
                            var line = 9000;
                            var column = 1;
                            Gork(fileName: ""Gizmo.cs"", line, column);
                        }
                    }
                }
            ";

            Expect.EmptyDiagnosticsFor(testCodeSnippet);
        }
Beispiel #7
0
 public void Empty_code_does_not_trigger_diagnostic()
 => Expect.EmptyDiagnosticsFor(@"");