No need to serialize the entire test case if we don't use it

This commit is contained in:
Dustin Campbell
2015-10-14 13:41:19 -07:00
parent 77ab0cbffe
commit e9735dfb2b
2 changed files with 3 additions and 11 deletions
+3 -10
View File
@@ -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);
-1
View File
@@ -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);