public void TestNormaliseMinus11() { var space = new Space1 { Min = -1, Max = 1, Normalised = Normalisation.Zero_one_ }; Assert.That(Math.Abs(space.Project(0.5f) - 0.75f) <= float.Epsilon, Is.True); }
public void TestNormalise010Throws(float v) { var space = new Space1 { Min = 0, Max = 10, Normalised = Normalisation.Zero_one_ }; Assert.That(() => space.Project(v), Throws.TypeOf <ArgumentException>()); }
public float TestNormalise010(float v, float min_value, float max_value) { var space = new Space1 { Min = min_value, Max = max_value, DecimalGranularity = 1, Normalised = Normalisation.Zero_one_ }; //Assert.AreEqual(expected, result, tolerance); return(space.Round(space.Project(v))); }