add ToJson method to CoverageResult class

This commit is contained in:
Oluwatoni Solarin-Sodara
2018-02-05 10:29:23 +01:00
parent 5e49dc1963
commit c743844823
2 changed files with 13 additions and 0 deletions
+12
View File
@@ -1,4 +1,7 @@
using System.Collections.Generic;
using System.IO;
using Jil;
namespace Coverlet.Core
{
@@ -10,5 +13,14 @@ namespace Coverlet.Core
{
public string Identifier;
public Data Data;
public string ToJson()
{
using (var writer = new StringWriter())
{
JSON.Serialize(this.Data, writer, Options.PrettyPrint);
return writer.ToString();
}
}
}
}
+1
View File
@@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Jil" Version="2.15.4" />
<PackageReference Include="Mono.Cecil" Version="0.10.0-beta7" />
<PackageReference Include="System.Reflection.Metadata" Version="1.5.0" />
</ItemGroup>