Skip to content

Commit 8a2f718

Browse files
committed
deserialize the error when reading from file to avoid hitting the JSON deserializer in benchmarks
1 parent 706a634 commit 8a2f718

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Source/Tests/Utility/ErrorDataReader.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Threading.Tasks;
77
using Exceptionless.Extensions;
88
using Exceptionless.Models;
9+
using Exceptionless.Models.Data;
910
using Exceptionless.Serializer;
1011

1112
namespace Exceptionless.Tests.Utility
@@ -21,7 +22,9 @@ static Event GetEvent(string fileName)
2122
{
2223
var json = File.ReadAllText(fileName);
2324
var serializer = GetSerializer();
24-
return serializer.Deserialize<Event>(json);
25+
var ev = serializer.Deserialize<Event>(json);
26+
ev.Data[Event.KnownDataKeys.Error] = ev.Data.GetValue<Error>(Event.KnownDataKeys.Error);
27+
return ev;
2528
}
2629
public static IEnumerable<Event> GetEvents() {
2730
return Directory.EnumerateFiles(@"..\..\ErrorData", "*.json").Select(GetEvent);

0 commit comments

Comments
 (0)