Skip to content

Instantly share code, notes, and snippets.

@aalmada
Created May 3, 2020 14:17
Show Gist options
  • Save aalmada/d5dd5cffcf865f7e43911cd9d50818a9 to your computer and use it in GitHub Desktop.
Save aalmada/d5dd5cffcf865f7e43911cd9d50818a9 to your computer and use it in GitHub Desktop.
[TestMethod]
public void TestMethod2()
{
var test = @"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
namespace ConsoleApplication1
{
class TypeName
{
}
}";
var expected = new DiagnosticResult
{
Id = "Analyzer1",
Message = String.Format("Type name '{0}' contains lowercase letters", "TypeName"),
Severity = DiagnosticSeverity.Warning,
Locations =
new[] {
new DiagnosticResultLocation("Test0.cs", 11, 15)
}
};
VerifyCSharpDiagnostic(test, expected);
var fixtest = @"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
namespace ConsoleApplication1
{
class TYPENAME
{
}
}";
VerifyCSharpFix(test, fixtest);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment