Skip to content

Commit

Permalink
Remove redundant code
Browse files Browse the repository at this point in the history
The line above already asserts that there should be no errors without using `MissingUsingsAreOk`, so the extra check does nothing
  • Loading branch information
simonmckenzie committed Aug 28, 2024
1 parent 37e79a7 commit e151b05
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions AutomaticInterface/Tests/GeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ private static string GenerateCode(string code)
.Should()
.BeEmpty();

sourceDiagnostics
.Where(d => d.Severity == DiagnosticSeverity.Error)
.Where(x => x.Id != "CS0246")
.Where(x => !MissingUsingsAreOk(x))
.Should()
.BeEmpty();

var generator = new AutomaticInterfaceGenerator();

CSharpGeneratorDriver
Expand All @@ -56,15 +49,6 @@ out var diagnostics
return outputCompilation.SyntaxTrees.Skip(1).LastOrDefault()?.ToString();
}

private static bool MissingUsingsAreOk(Diagnostic x)
{
var locString = x.ToString();
return locString.Contains(AutomaticInterfaceGenerator.DefaultAttributeName)
|| locString.Contains(
AutomaticInterfaceGenerator.IgnoreAutomaticInterfaceAttributeName
);
}

[Fact]
public void WorksWithOptionalParameters()
{
Expand Down

0 comments on commit e151b05

Please sign in to comment.