public void Just_Bind_ReturnsNothing() { var just = new Just<string>("4"); var just2 = just.Bind<string>(a => new Nothing<string>()); var result = just2.FMap<int>(a => Int32.Parse(a)); Assert.IsInstanceOf<Nothing<int>>(result); }
public void Just_Bind_ReturnsNothing() { var just = new Just <string>("4"); var just2 = just.Bind <string>(a => new Nothing <string>()); var result = just2.FMap <int>(a => Int32.Parse(a)); Assert.IsInstanceOf <Nothing <int> >(result); }
public void Just_Bind_ReturnsJust() { var just = new Just<string>("4"); var just2 = just.Bind<string>(a => new Just<string>(a + "2")); var result = just2.FMap<int>(a => Int32.Parse(a)); Assert.IsInstanceOf<Just<int>>(result); var actualResult = result as Just<int>; Assert.AreEqual(42, actualResult.Value); }
public void Just_Bind_ReturnsJust() { var just = new Just <string>("4"); var just2 = just.Bind <string>(a => new Just <string>(a + "2")); var result = just2.FMap <int>(a => Int32.Parse(a)); Assert.IsInstanceOf <Just <int> >(result); var actualResult = result as Just <int>; Assert.AreEqual(42, actualResult.Value); }