Skip to content

Instantly share code, notes, and snippets.

@JohanLarsson
Created February 10, 2014 19:01
Show Gist options
  • Save JohanLarsson/8922037 to your computer and use it in GitHub Desktop.
Save JohanLarsson/8922037 to your computer and use it in GitHub Desktop.
[TestCase("15 °", "-10 °", 25, typeof(Degrees))]
[TestCase("-10 °", "15 °", -25, typeof(Degrees))]
[TestCase("-10 °", "0 °", -10, typeof(Degrees))]
[TestCase("-90 °", "1.5707 rad", -3.1414, typeof(Radians))]
[TestCase("1.5707 rad", "-90 °", 3.1414, typeof(Radians))]
[TestCase("1.5707 rad", "1.5707 rad", 0, typeof(Radians))]
public void SubtractionTest(string lvs, string rvs, double ev, Type et)
{
var lv = AngleUnitValue.Parse(lvs);
var rv = AngleUnitValue.Parse(rvs);
var diff = lv - rv;
Assert.AreEqual(ev, diff.Value, 1e-3);
Assert.AreEqual(et, diff.Unit.GetType());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment