示例#1
0
        public void Just_FMap_ReturnsNothing()
        {
            var just   = new Just <string>("Hello");
            var result = just.FMap <int>(a => Int32.Parse(a));

            Assert.IsInstanceOf <Nothing <int> >(result);
        }
示例#2
0
 public void Just_FMap_ReturnsJust()
 {
     var just = new Just<string>("42");
     var result = just.FMap<int>(a => Int32.Parse(a));
     Assert.IsInstanceOf<Just<int>>(result);
     var actualResult = result as Just<int>;
     Assert.AreEqual(42, actualResult.Value);
 }
示例#3
0
        public void Just_FMap_ReturnsJust()
        {
            var just   = new Just <string>("42");
            var result = just.FMap <int>(a => Int32.Parse(a));

            Assert.IsInstanceOf <Just <int> >(result);
            var actualResult = result as Just <int>;

            Assert.AreEqual(42, actualResult.Value);
        }
示例#4
0
 public void Just_FMap_ReturnsNothing()
 {
     var just = new Just<string>("Hello");
     var result = just.FMap<int>(a => Int32.Parse(a));
     Assert.IsInstanceOf<Nothing<int>>(result);
 }