Exemple #1
0
        public void SelectValueOrDefault_DefaultNull()
        {
            Nullable <int> subject = null;

            string result = subject.SelectValueOrDefault(v => v.ToString(), null);

            Assert.AreEqual(null, result);
        }
Exemple #2
0
        public void SelectValueOrDefault_ValueNotNull()
        {
            Nullable <int> subject = 1;

            string result = subject.SelectValueOrDefault(v => v.ToString(), string.Empty);

            Assert.AreEqual("1", result);
        }
Exemple #3
0
        public void SelectValueOrDefault_ValueNull_Throws()
        {
            Nullable <int> subject = null;

            string result = subject.SelectValueOrDefault(null, string.Empty);
        }