Beispiel #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);
        }
Beispiel #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);
 }
Beispiel #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);
        }
Beispiel #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);
 }