Skip to content

Commit

Permalink
Naming and sort order
Browse files Browse the repository at this point in the history
  • Loading branch information
bradwilson committed May 21, 2024
1 parent 3fdb56a commit 2100542
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
36 changes: 18 additions & 18 deletions src/xunit.analyzers/Utility/TypeSymbolFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,27 @@ public static class TypeSymbolFactory
public static INamedTypeSymbol? IAssemblyInfo_V2(Compilation compilation) =>
Guard.ArgumentNotNull(compilation).GetTypeByMetadataName("Xunit.Abstractions.IAssemblyInfo");

public static INamedTypeSymbol? IAsyncEnumerableOfObjectArray(Compilation compilation)
public static INamedTypeSymbol? IAsyncEnumerableOfITheoryDataRow(Compilation compilation)
{
var iAsyncEnumerableOfT = IAsyncEnumerableOfT(compilation);
if (iAsyncEnumerableOfT is null)
return null;

var objectArray = ObjectArray(compilation);
return iAsyncEnumerableOfT.Construct(objectArray);
var iTheoryDataRow = ITheoryDataRow(compilation);
if (iTheoryDataRow is null)
return null;

return iAsyncEnumerableOfT.Construct(iTheoryDataRow);
}

public static INamedTypeSymbol? IAsyncEnumerableOfTheoryDataRow(Compilation compilation)
public static INamedTypeSymbol? IAsyncEnumerableOfObjectArray(Compilation compilation)
{
var iAsyncEnumerableOfT = IAsyncEnumerableOfT(compilation);
if (iAsyncEnumerableOfT is null)
return null;

var iTheoryDataRow = ITheoryDataRow(compilation);
if (iTheoryDataRow is null)
return null;

return iAsyncEnumerableOfT.Construct(iTheoryDataRow);
var objectArray = ObjectArray(compilation);
return iAsyncEnumerableOfT.Construct(objectArray);
}

public static INamedTypeSymbol? IAsyncEnumerableOfT(Compilation compilation) =>
Expand Down Expand Up @@ -118,15 +118,6 @@ public static INamedTypeSymbol ICollectionOfT(Compilation compilation) =>
public static INamedTypeSymbol IDisposable(Compilation compilation) =>
Guard.ArgumentNotNull(compilation).GetSpecialType(SpecialType.System_IDisposable);

public static INamedTypeSymbol IEnumerableOfObjectArray(Compilation compilation)
{
var iEnumerableOfT = Guard.ArgumentNotNull(compilation).GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T);
var objectArray = ObjectArray(compilation);
var iEnumerableOfObjectArray = iEnumerableOfT.Construct(objectArray);

return iEnumerableOfObjectArray;
}

public static INamedTypeSymbol? IEnumerableOfITheoryDataRow(Compilation compilation)
{
var iTheoryDataRow = ITheoryDataRow(compilation);
Expand All @@ -137,6 +128,15 @@ public static INamedTypeSymbol IEnumerableOfObjectArray(Compilation compilation)
return iEnumerableOfT.Construct(iTheoryDataRow);
}

public static INamedTypeSymbol IEnumerableOfObjectArray(Compilation compilation)
{
var iEnumerableOfT = Guard.ArgumentNotNull(compilation).GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T);
var objectArray = ObjectArray(compilation);
var iEnumerableOfObjectArray = iEnumerableOfT.Construct(objectArray);

return iEnumerableOfObjectArray;
}

public static INamedTypeSymbol? IMessageSink_V2(Compilation compilation) =>
Guard.ArgumentNotNull(compilation).GetTypeByMetadataName("Xunit.Abstractions.IMessageSink");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ memberReturnType is INamedTypeSymbol namedMemberReturnType &&

// Make sure the member returns a compatible type
var iEnumerableOfTheoryDataRowType = TypeSymbolFactory.IEnumerableOfITheoryDataRow(compilation);
var iAsyncEnumerableOfTheoryDataRowType = TypeSymbolFactory.IAsyncEnumerableOfTheoryDataRow(compilation);
var iAsyncEnumerableOfTheoryDataRowType = TypeSymbolFactory.IAsyncEnumerableOfITheoryDataRow(compilation);
var IsValidMemberReturnType =
VerifyDataSourceReturnType(context, compilation, xunitContext, memberReturnType, memberProperties, attributeSyntax, iEnumerableOfTheoryDataRowType, iAsyncEnumerableOfTheoryDataRowType);

Expand Down

0 comments on commit 2100542

Please sign in to comment.