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

chore: remove dependency on System.ValueTuple. #82

Merged
merged 2 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/JUnit.Xml.TestLogger/JUnit.Xml.TestLogger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@

<ItemGroup>
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="15.5.0" />
<PackageReference Include="System.ValueTuple" Version="4.3.0" />
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion src/NUnit.Xml.TestLogger/NUnit.Xml.TestLogger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

<ItemGroup>
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="15.5.0" />
<PackageReference Include="System.ValueTuple" Version="4.3.0" />
</ItemGroup>

</Project>
1 change: 0 additions & 1 deletion src/Xunit.Xml.TestLogger/Xunit.Xml.TestLogger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

<ItemGroup>
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="15.5.0" />
<PackageReference Include="System.ValueTuple" Version="4.3.0" />
</ItemGroup>

</Project>
33 changes: 25 additions & 8 deletions src/Xunit.Xml.TestLogger/XunitXmlSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ orderby resultsByType.Key

foreach (var collection in collections)
{
total += collection.total;
passed += collection.passed;
failed += collection.failed;
skipped += collection.skipped;
errors += collection.error;
total += collection.Total;
passed += collection.Passed;
failed += collection.Failed;
skipped += collection.Skipped;
errors += collection.Error;

element.Add(collection.element);
element.Add(collection.Element);
}

// Handle errors
Expand Down Expand Up @@ -175,7 +175,7 @@ private static XElement CreateFailureElement(string exceptionType, string messag
return failureElement;
}

private static (XElement element, int total, int passed, int failed, int skipped, int error, TimeSpan time) CreateCollection(IGrouping<string, TestResultInfo> resultsByType, List<TestResultInfo> testResultAsError)
private static TestCollection CreateCollection(IGrouping<string, TestResultInfo> resultsByType, List<TestResultInfo> testResultAsError)
{
var element = new XElement("collection");

Expand Down Expand Up @@ -227,7 +227,7 @@ private static (XElement element, int total, int passed, int failed, int skipped
element.SetAttributeValue("name", $"Test collection for {resultsByType.Key}");
element.SetAttributeValue("time", time.TotalSeconds.ToString("F3", CultureInfo.InvariantCulture));

return (element, total, passed, failed, skipped, error, time);
return new TestCollection { Element = element, Total = total, Passed = passed, Failed = failed, Skipped = skipped, Error = error, Time = time };
}

private static bool IsError(TestResultInfo result)
Expand Down Expand Up @@ -318,5 +318,22 @@ private static string OutcomeToString(TestOutcome outcome)
return "Unknown";
}
}

private class TestCollection
{
public XElement Element { get; set; }

public int Total { get; set; }

public int Passed { get; set; }

public int Failed { get; set; }

public int Skipped { get; set; }

public int Error { get; set; }

public TimeSpan Time { get; set; }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,5 @@
<ItemGroup>
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="15.5.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.ValueTuple" Version="4.3.0" />
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion test/Json.TestLogger/Json.TestLogger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<ItemGroup>
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="15.5.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.ValueTuple" Version="4.3.0" />
</ItemGroup>

</Project>
Loading