示例#1
0
 public void ApplicativeContractLawForExc(Exc <int, Exception> first, Exc <int, Exception> second, Exc <int, Exception> third)
 {
     UnitTest(
         _ => func((int a, int b, int c) => a / b * c),
         f => rec(first.Map(f.Apply).Validate(second).Validate(third), success <Func <int, int, int, int>, Exception>(f).Validate(first).Validate(second).Validate(third)),
         r => Assert.Equal(r.Item1.Success, r.Item2.Success)
         );
 }
示例#2
0
 public void ApplicativeLawForExc(Exc <int, DivideByZeroException> first, Exc <int, DivideByZeroException> second)
 {
     UnitTest(
         _ => func((int a, int b) => a / b),
         f => rec(first.Map(f.Apply).Apply(second), success <Func <int, int, int>, DivideByZeroException>(f).Apply(first).Apply(second)),
         r => Assert.Equal(r.Item1.Success, r.Item2.Success)
         );
 }