Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix S2699 FP: Support NUnit TestCase and ExpectedResult #2451

Closed
sm-g opened this issue Jun 12, 2019 · 0 comments · Fixed by #2707
Closed

Fix S2699 FP: Support NUnit TestCase and ExpectedResult #2451

sm-g opened this issue Jun 12, 2019 · 0 comments · Fixed by #2707
Labels
Area: C# C# rules related issues. Type: Bug Exceptions and blocking issues during analysis. Type: False Positive Rule IS triggered when it shouldn't be.
Milestone

Comments

@sm-g
Copy link

sm-g commented Jun 12, 2019

On version 7.9.1.7622 this is ok:

using System;
using System.Collections.Generic;
using NUnit.Framework;

namespace ByValue
{
    [TestFixture]
    public class TypeExtensionsTests
    {
        [TestCase(typeof(string), ExpectedResult = "System.String")]
        [TestCase(typeof(string[]), ExpectedResult = "System.String[]")]
        [TestCase(typeof(List<string>), ExpectedResult = "List<System.String>")]
        [TestCase(typeof(List<(string, int)>), ExpectedResult = "List<ValueTuple<System.String,System.Int32>>")]
        public string GetFriendlyFullName(Type type)
        {
            return type.GetFriendlyFullName();
        }
    }
}

after upgrade to 7.14.0.8411, I got S2699

  • Visual Studio 2019
@andrei-epure-sonarsource andrei-epure-sonarsource added this to the Support milestone Jul 30, 2019
@andrei-epure-sonarsource andrei-epure-sonarsource added Area: C# C# rules related issues. Type: False Positive Rule IS triggered when it shouldn't be. Type: Bug Exceptions and blocking issues during analysis. and removed Status: Needs Review labels Oct 9, 2019
@andrei-epure-sonarsource andrei-epure-sonarsource removed this from the Support milestone Oct 9, 2019
@andrei-epure-sonarsource andrei-epure-sonarsource added this to the 8.0 milestone Oct 21, 2019
@andrei-epure-sonarsource andrei-epure-sonarsource changed the title S2699 false positive after upgrade Fix S2699 FP: Support NUnit TestCase and ExpectedResult Oct 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C# C# rules related issues. Type: Bug Exceptions and blocking issues during analysis. Type: False Positive Rule IS triggered when it shouldn't be.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants