public void FormatAsFractionsPiHalf() { var axis = new LinearAxis { FormatAsFractions = true, FractionUnit = Math.PI, FractionUnitSymbol = "π" }; Assert.AreEqual("π/2", axis.FormatValue(0.5 * Math.PI)); }
public void FormatAsFractionsZero() { var axis = new LinearAxis { FormatAsFractions = true, FractionUnit = Math.PI, FractionUnitSymbol = "π" }; Assert.AreEqual("0", axis.FormatValue(0)); }
public void FormatAsFractionsThreeHalfPi() { var axis = new LinearAxis { FormatAsFractions = true, FractionUnit = Math.PI, FractionUnitSymbol = "π" }; Assert.AreEqual("3π/2", axis.FormatValue(3d / 2 * Math.PI)); }
public void FormatAsFractionsTwoPi() { var axis = new LinearAxis { FormatAsFractions = true, FractionUnit = Math.PI, FractionUnitSymbol = "π" }; Assert.AreEqual("2π", axis.FormatValue(2 * Math.PI)); }
public void FormatAsFractionsWithStringFormat() { var model = new PlotModel { Culture = CultureInfo.InvariantCulture }; var axis = new LinearAxis { FormatAsFractions = true, FractionUnit = Math.PI, FractionUnitSymbol = "π", StringFormat = "0.###" }; model.Axes.Add(axis); ((IPlotModel)model).Update(true); Assert.AreEqual("1.273π", axis.FormatValue(4)); }