Skip to content

Commit

Permalink
Added a unit test to check warning output. Check it out!
Browse files Browse the repository at this point in the history
  • Loading branch information
hayakawa16 committed Aug 8, 2024
1 parent 37ef542 commit 337e86a
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.IO;
using NUnit.Framework;
using Vts.Modeling.ForwardSolvers;

Expand Down Expand Up @@ -44,7 +45,15 @@ public void Validate_Create_method_results()
Assert.IsTrue(Math.Abs(1.01 - diffusionParameters.mutr) < 1e-6);
Assert.IsTrue(Math.Abs(1.947246 - diffusionParameters.zb) < 1e-6);
Assert.IsTrue(Math.Abs(0.552486 - diffusionParameters.zp) < 1e-6);
// add test to test warning
// add test to test warning if Mua >= Musp
ops = new OpticalProperties(1.0, 1.0, 0.8, 1.4);
var output = new StringWriter();
Console.SetOut(output);
diffusionParameters = DiffusionParameters.Create(
ops,
ForwardModel.SDA);
Assert.IsTrue(diffusionParameters != null);
Assert.That(output.ToString(), Is.EqualTo("Warning: Mua >= Musp\r\n"));
}

/// <summary>
Expand Down

0 comments on commit 337e86a

Please sign in to comment.