public void AsyncOperationCreationSuccess() { var task = Operation.Run(async() => { await Task.Run(() => Console.WriteLine("Hello Operation")); }); task.Wait(); Assert.IsTrue(task.Result.Succeeded); }
public void AsyncOperationCreationFailure() { var task = Operation.Run(async() => { await Task.Run(() => Console.WriteLine("Hello Operation")); throw new Exception("The Error"); }); task.Wait(); Assert.IsFalse(task.Result.Succeeded); Assert.AreEqual(task.Result.Message, "The Error"); }
public void RunAsync(IEnumerable<Action> enumerable) { Operation operation = new Operation(enumerable, context); operation.Run(); }