public void ShouldFailToConvertToCSharpValue() { //Arrange object value0; object value1; object value2; var converter = new IntConverter(); //Act bool success0 = converter.TryConvertToCSharpValue("9E10D", out value0); bool success1 = converter.TryConvertToCSharpValue("N/A", out value1); bool success2 = converter.TryConvertToCSharpValue("NaN", out value2); //Assert Assert.IsFalse(success0); Assert.IsFalse(success1); Assert.IsFalse(success2); }
public void ShouldConvertToCSharpValue() { //Arrange object value0; object value1; object value2; var converter = new IntConverter(); //Act bool success0 = converter.TryConvertToCSharpValue("123", out value0); bool success1 = converter.TryConvertToCSharpValue("-1000", out value1); bool success2 = converter.TryConvertToCSharpValue("0", out value2); //Assert Assert.IsTrue(success0); Assert.IsTrue(success1); Assert.IsTrue(success2); Assert.AreEqual(123, value0); Assert.AreEqual(-1000, value1); Assert.AreEqual(0, value2); }