public void Distance_ToString_NumberOfDecimals() { // arrange Distance Distance = new Distance(new Millimeter(), 14.1875); Distance Distance2 = new Distance(new Millimeter(), 0.0001); Distance Distance3 = new Distance(new Millimeter(), 1.13); //should come back rounded due // act // assert Distance.ToString(3).Should().Be("14.188 mm"); Distance2.ToString(1).Should().Be("0 mm"); Distance3.ToString(0).Should().Be("1 mm"); }
public void Distance_ToString() { // arrange Distance Distance = new Distance(new Millimeter(), 14.1875); Distance Distance2 = new Distance(new Millimeter(), 0); Distance Distance3 = new Distance(new Millimeter(), 1.13); //should come back rounded due // act // assert Distance.ToString().Should().Be("14 mm"); Distance2.ToString().Should().Be("0 mm"); Distance3.ToString().Should().Be("1 mm"); }