public async Task Add()
        {

            
            var logic = new AsyncLogic();

            var r = await logic.DoSomethingAsync(5, 5);

            Assert.That(r, Is.EqualTo(10));

        }
Beispiel #2
0
        static void Main(string[] args)
        {
            var mre        = new ManualResetEvent(false);
            var asyncLogic = new AsyncLogic();

            asyncLogic.Completed += (s, e) => mre.Set();
            asyncLogic.Start();
            mre.WaitOne();
            Console.WriteLine("Completed, press Enter to exit");
            Console.ReadLine();
        }