No need to serialize the entire test case if we don't use it
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace xunit.runner.data
|
||||
{
|
||||
@@ -15,9 +11,8 @@ namespace xunit.runner.data
|
||||
public string AssemblyPath { get; set; }
|
||||
public Dictionary<string, List<string>> TraitMap { get; set; }
|
||||
|
||||
public TestCaseData(string serializedForm, string displayName, string assemblyPath, Dictionary<string, List<string>> traitMap)
|
||||
public TestCaseData(string displayName, string assemblyPath, Dictionary<string, List<string>> traitMap)
|
||||
{
|
||||
SerializedForm = serializedForm;
|
||||
DisplayName = displayName;
|
||||
AssemblyPath = assemblyPath;
|
||||
TraitMap = traitMap;
|
||||
@@ -26,17 +21,15 @@ namespace xunit.runner.data
|
||||
public static TestCaseData ReadFrom(BinaryReader reader)
|
||||
{
|
||||
var formatter = new BinaryFormatter();
|
||||
var serializedForm = reader.ReadString();
|
||||
var displayName = reader.ReadString();
|
||||
var assemblyPath = reader.ReadString();
|
||||
var traitMap = (Dictionary<string, List<string>>)formatter.Deserialize(reader.BaseStream);
|
||||
return new TestCaseData(serializedForm, displayName, assemblyPath, traitMap);
|
||||
return new TestCaseData(displayName, assemblyPath, traitMap);
|
||||
}
|
||||
|
||||
public void WriteTo(BinaryWriter writer)
|
||||
{
|
||||
var formatter = new BinaryFormatter();
|
||||
writer.Write(SerializedForm);
|
||||
writer.Write(DisplayName);
|
||||
writer.Write(AssemblyPath);
|
||||
formatter.Serialize(writer.BaseStream, TraitMap);
|
||||
|
||||
@@ -29,7 +29,6 @@ namespace xunit.runner.worker
|
||||
{
|
||||
var testCase = testCaseDiscovered.TestCase;
|
||||
var testCaseData = new TestCaseData(
|
||||
_discoverer.Serialize(testCase),
|
||||
testCase.DisplayName,
|
||||
testCaseDiscovered.TestAssembly.Assembly.AssemblyPath,
|
||||
testCase.Traits);
|
||||
|
||||
Reference in New Issue
Block a user