Output only one mapping failure per mapping

This commit is contained in:
smoogipoo 2018-06-15 18:20:28 +09:00
parent e945186978
commit 47ae962099
1 changed files with 12 additions and 8 deletions

View File

@ -43,14 +43,22 @@ protected void Test(string name)
Assert.Fail($"A conversion did not generate any hitobjects, but should have, for hitobject at time: {expectedResult.Mappings[mappingCounter].StartTime}\n");
else if (mappingCounter >= expectedResult.Mappings.Count)
Assert.Fail($"A conversion generated hitobjects, but should not have, for hitobject at time: {ourResult.Mappings[mappingCounter].StartTime}\n");
else if (!expectedResult.Mappings[mappingCounter].Equals(ourResult.Mappings[mappingCounter]))
{
var expectedMapping = expectedResult.Mappings[mappingCounter];
var ourMapping = ourResult.Mappings[mappingCounter];
Assert.Fail($"The conversion mapping differed for object at time {expectedMapping.StartTime}:\n"
+ $"Expected {JsonConvert.SerializeObject(expectedMapping)}\n"
+ $"Received: {JsonConvert.SerializeObject(ourMapping)}\n");
}
else
{
var counter = mappingCounter;
var ourMapping = ourResult.Mappings[mappingCounter];
var expectedMapping = expectedResult.Mappings[mappingCounter];
Assert.Multiple(() =>
{
var ourMapping = ourResult.Mappings[counter];
var expectedMapping = expectedResult.Mappings[counter];
int objectCounter = 0;
while (true)
{
@ -62,10 +70,6 @@ protected void Test(string name)
else if (objectCounter >= expectedMapping.Objects.Count)
Assert.Fail($"The conversion generated a hitobject, but should not have, for hitobject at time: {ourMapping.StartTime}:\n"
+ $"Received: {JsonConvert.SerializeObject(ourMapping.Objects[objectCounter])}\n");
else if (!expectedMapping.Equals(ourMapping))
Assert.Fail($"The conversion mapping differed for object at time {expectedMapping.StartTime}:\n"
+ $"Expected {JsonConvert.SerializeObject(expectedMapping)}\n"
+ $"Received: {JsonConvert.SerializeObject(ourMapping)}\n");
else if (!expectedMapping.Objects[objectCounter].Equals(ourMapping.Objects[objectCounter]))
{
Assert.Fail($"The conversion generated differing hitobjects for object at time: {expectedMapping.StartTime}:\n"