예제 #1
0
        public async Task FromFunc_Typed_HappyPath()
        {
            int counter = 0;
            var eff     = Eff.FromFunc(async() => ++ counter);

            Assert.Equal(0, counter);
            Assert.Equal(1, await eff.Run(Handler));
            Assert.Equal(1, counter);
        }
예제 #2
0
 public async Task FromFunc_Untyped_Exception()
 {
     var eff = Eff.FromFunc(async() => { throw new DivideByZeroException(); });
     await Assert.ThrowsAsync <DivideByZeroException>(() => eff.Run(Handler));
 }