public void GetText_NumericRounding_CorrectHeader() { var formatter = new TableHeaderHelper(); var text = formatter.GetText(ColumnRole.Value, ColumnType.Numeric, null, new NumericRounding(10.5, Rounding.RoundingStyle.Round)); Assert.That(text, Is.StringContaining("VALUE")); Assert.That(text, Is.StringContaining("Numeric")); Assert.That(text, Is.StringContaining("(round 10.5)")); }
public void GetText_DateTimeRounding_CorrectHeader() { var formatter = new TableHeaderHelper(); var text = formatter.GetText(ColumnRole.Value, ColumnType.DateTime, null, new DateTimeRounding(new TimeSpan(0, 15, 0), Rounding.RoundingStyle.Floor)); Assert.That(text, Is.StringContaining("VALUE")); Assert.That(text, Is.StringContaining("DateTime")); Assert.That(text, Is.StringContaining("(floor 00:15:00)")); }
public void GetText_DateTimeTolerance_CorrectHeader() { var formatter = new TableHeaderHelper(); var text = formatter.GetText(ColumnRole.Value, ColumnType.DateTime, new DateTimeTolerance(new TimeSpan(0, 15, 0)), null); Assert.That(text, Is.StringContaining("VALUE")); Assert.That(text, Is.StringContaining("DateTime")); Assert.That(text, Is.StringContaining("(+/- 00:15:00)")); }
public void GetText_NumericPercentageOneSidedMoreTolerance_CorrectHeader() { var formatter = new TableHeaderHelper(); var text = formatter.GetText(ColumnRole.Value, ColumnType.Numeric, new NumericPercentageTolerance(new decimal(0.125), SideTolerance.More), null); Assert.That(text, Is.StringContaining("VALUE")); Assert.That(text, Is.StringContaining("Numeric")); Assert.That(text, Is.StringContaining("(+/- +12.500%)")); }
public void GetText_NumericAbsoluteOnSidedLessTolerance_CorrectHeader() { var formatter = new TableHeaderHelper(); var text = formatter.GetText(ColumnRole.Value, ColumnType.Numeric, new NumericAbsoluteTolerance(new decimal(0.5), SideTolerance.Less), null); Assert.That(text, Is.StringContaining("VALUE")); Assert.That(text, Is.StringContaining("Numeric")); Assert.That(text, Is.StringContaining("(+/- -0.5)")); }
public void GetText_NoToleranceOrRounding_DoesntEndWithSpace() { var formatter = new TableHeaderHelper(); var text = formatter.GetText(ColumnRole.Value, ColumnType.Numeric, null, null); Assert.That(text, Is.StringContaining("VALUE")); Assert.That(text, Is.StringContaining("Numeric")); Assert.That(text, Is.Not.StringEnding(" ")); }