Skip to content

Commit

Permalink
S2275, S3457: Add UTs for collection expressions + refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioaversa committed Oct 4, 2023
1 parent 4e47d2e commit 6d38c61
Show file tree
Hide file tree
Showing 12 changed files with 422 additions and 414 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,43 +30,50 @@ public class StringFormatValidatorTest
[DataTestMethod]
[DataRow(ProjectType.Product)]
[DataRow(ProjectType.Test)]
public void StringFormatRuntimeExceptionFreeValidator(ProjectType projectType) =>
builder.AddPaths("StringFormatRuntimeExceptionFreeValidator.cs")
public void StringFormatValidator_RuntimeExceptionFree(ProjectType projectType) =>
builder.AddPaths("StringFormatValidator.RuntimeExceptionFree.cs")
.AddReferences(TestHelper.ProjectTypeReference(projectType))
.Verify();

[DataTestMethod]
[DataRow(ProjectType.Product)]
[DataRow(ProjectType.Test)]
public void StringFormatTypoFreeValidator(ProjectType projectType) =>
builder.AddPaths("StringFormatTypoFreeValidator.cs")
public void StringFormatValidator_TypoFree(ProjectType projectType) =>
builder.AddPaths("StringFormatValidator.TypoFree.cs")
.AddReferences(TestHelper.ProjectTypeReference(projectType))
.Verify();

[TestMethod]
public void StringFormatEdgeCasesValidator() =>
builder.AddPaths("StringFormatEdgeCasesValidator.cs").Verify();
public void StringFormatValidator_EdgeCases() =>
builder.AddPaths("StringFormatValidator.EdgeCases.cs").Verify();

#if NET

[DataTestMethod]
[DataRow(ProjectType.Product)]
[DataRow(ProjectType.Test)]
public void StringFormatRuntimeExceptionFreeValidator_CSharp11(ProjectType projectType) =>
builder.AddPaths("StringFormatRuntimeExceptionFreeValidator.CSharp11.cs")
public void StringFormatValidator_RuntimeExceptionFree_CSharp11(ProjectType projectType) =>
builder.AddPaths("StringFormatValidator.RuntimeExceptionFree.CSharp11.cs")
.AddReferences(TestHelper.ProjectTypeReference(projectType))
.WithOptions(ParseOptionsHelper.FromCSharp11)
.Verify();

[DataTestMethod]
[DataRow(ProjectType.Product)]
[DataRow(ProjectType.Test)]
public void StringFormatTypoFreeValidator_CSharp11(ProjectType projectType) =>
builder.AddPaths("StringFormatTypoFreeValidator.CSharp11.cs")
public void StringFormatValidator_TypoFree_CSharp11(ProjectType projectType) =>
builder.AddPaths("StringFormatValidator.TypoFree.CSharp11.cs")
.AddReferences(TestHelper.ProjectTypeReference(projectType))
.WithOptions(ParseOptionsHelper.FromCSharp11)
.Verify();

[TestMethod]
public void StringFormatValidator_CSharp12() =>
builder.AddPaths("StringFormatValidator.CSharp12.cs")
.AddReferences(TestHelper.ProjectTypeReference(ProjectType.Product))
.WithOptions(ParseOptionsHelper.FromCSharp12)
.Verify();

#endif

}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 6d38c61

Please sign in to comment.