Skip to content

Commit

Permalink
Merge pull request #164 from VirtualPhotonics/hotfix/163-unit-tests-t…
Browse files Browse the repository at this point in the history
…hat-compare-output-strings-do-not-work-on-linux

Modified string comparision to add "Trim()" so that tests work on bot…
  • Loading branch information
hayakawa16 authored Aug 23, 2024
2 parents 79cf8e5 + 8d3151d commit b2bca9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public void Validate_ellipsoid_tissue_with_off_zaxis_center_and_cylindrical_dete
Console.SetOut(output);
var result = SimulationInputValidation.ValidateInput(input);
Assert.IsTrue(result.IsValid); // only warning
Assert.That(output.ToString(), Is.EqualTo("Warning: off center ellipsoid in tissue with cylindrical detector defined: user discretion advised\r\n"));
Assert.That(output.ToString().Trim(), Is.EqualTo("Warning: off center ellipsoid in tissue with cylindrical detector defined: user discretion advised"));
}

/// <summary>
Expand All @@ -158,7 +158,7 @@ public void Validate_ellipsoid_tissue_without_cylindrical_symmetry_and_cylindric
Console.SetOut(output);
var result = SimulationInputValidation.ValidateInput(input);
Assert.IsTrue(result.IsValid); // only warning
Assert.That(output.ToString(), Is.EqualTo("Warning: ellipsoid with Dx != Dy in tissue with cylindrical detector defined: user discretion advised\r\n"));
Assert.That(output.ToString().Trim(), Is.EqualTo("Warning: ellipsoid with Dx != Dy in tissue with cylindrical detector defined: user discretion advised"));
}

/// <summary>
Expand Down Expand Up @@ -187,7 +187,7 @@ public void Validate_voxel_tissue_and_cylindrical_detectors_issues_warning()
Console.SetOut(output);
var result = SimulationInputValidation.ValidateInput(input);
Assert.IsTrue(result.IsValid); // only warning
Assert.That(output.ToString(), Is.EqualTo("Warning: voxel in tissue with cylindrical detector defined: user discretion advised\r\n"));
Assert.That(output.ToString().Trim(), Is.EqualTo("Warning: voxel in tissue with cylindrical detector defined: user discretion advised"));
}

/// <summary>
Expand Down Expand Up @@ -226,7 +226,7 @@ public void Validate_angled_source_and_cylindrical_detectors_are_not_defined_tog
Console.SetOut(output);
var result = SimulationInputValidation.ValidateInput(input);
Assert.IsTrue(result.IsValid); // only warning
Assert.That(output.ToString(), Is.EqualTo("Warning: Angled source and cylindrical coordinate detector defined: user discretion advised\r\n"));
Assert.That(output.ToString().Trim(), Is.EqualTo("Warning: Angled source and cylindrical coordinate detector defined: user discretion advised"));
}

/// <summary>
Expand Down Expand Up @@ -271,7 +271,7 @@ public void Validate_ellipsoid_tissue_and_ROfFx_detectors_defined_together_issue
Console.SetOut(output);
var result = SimulationInputValidation.ValidateInput(input);
Assert.IsTrue(result.IsValid); // only warning
Assert.That(output.ToString(), Is.EqualTo("Warning: R(fx) theory assumes a homogeneous or layered tissue geometry: user discretion advised\r\n"));
Assert.That(output.ToString().Trim(), Is.EqualTo("Warning: R(fx) theory assumes a homogeneous or layered tissue geometry: user discretion advised"));
}

/// <summary>
Expand Down Expand Up @@ -301,7 +301,7 @@ public void Validate_voxel_tissue_and_ROfFx_detectors_defined_together_issues_wa
Console.SetOut(output);
var result = SimulationInputValidation.ValidateInput(input);
Assert.IsTrue(result.IsValid); // only warning
Assert.That(output.ToString(), Is.EqualTo("Warning: R(fx) theory assumes a homogeneous or layered tissue geometry: user discretion advised\r\n"));
Assert.That(output.ToString().Trim(), Is.EqualTo("Warning: R(fx) theory assumes a homogeneous or layered tissue geometry: user discretion advised"));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void Validate_Create_method_results()
ops,
ForwardModel.SDA);
Assert.IsTrue(diffusionParameters != null);
Assert.That(output.ToString(), Is.EqualTo("Warning: Mua >= Musp\r\n"));
Assert.That(output.ToString().Trim(), Is.EqualTo("Warning: Mua >= Musp"));
}

/// <summary>
Expand Down

0 comments on commit b2bca9f

Please sign in to comment.