public void SelectValueOrDefault_DefaultNull() { Nullable <int> subject = null; string result = subject.SelectValueOrDefault(v => v.ToString(), null); Assert.AreEqual(null, result); }
public void SelectValueOrDefault_ValueNotNull() { Nullable <int> subject = 1; string result = subject.SelectValueOrDefault(v => v.ToString(), string.Empty); Assert.AreEqual("1", result); }
public void SelectValueOrDefault_ValueNull_Throws() { Nullable <int> subject = null; string result = subject.SelectValueOrDefault(null, string.Empty); }