public void ShouldConvertToCellValue() { //Arrange //Act var converter = new NullableBooleanConverter(); string value0; string value1; string value2; bool success0 = converter.TryConvertToCellValue(false, out value0); bool success1 = converter.TryConvertToCellValue(true, out value1); bool success2 = converter.TryConvertToCellValue(null, out value2); //Assert Assert.IsTrue(success0); Assert.IsTrue(success1); Assert.IsTrue(success2); Assert.AreEqual("0", value0); Assert.AreEqual("1", value1); Assert.IsTrue(string.IsNullOrEmpty(value2)); }
public void ShouldFailToConvertToCellValue() { //Arrange //Act var converter = new NullableBooleanConverter(); string value0; string value1; bool success0 = converter.TryConvertToCellValue("True", out value0); bool success1 = converter.TryConvertToCellValue("bbb", out value1); //Assert Assert.IsFalse(success0); Assert.IsFalse(success1); }