Exemplo n.º 1
0
 public void AsyncTask00()
 {
     Assert.Throws <ArgumentNullException>(() =>
     {
         // The first argument cannot be null.
         var task = new SampleAsyncTask(null);
     });
 }
Exemplo n.º 2
0
 public void AsyncTask00()
 {
     Assert.Throws<ArgumentNullException>(() =>
     {
         // The first argument cannot be null.
         var task = new SampleAsyncTask(null);
     });
 }
Exemplo n.º 3
0
        public void AsyncTask00()
        {
            Assert.Throws<ArgumentNullException>(() =>
            {
                // The first argument cannot be null.
                var task = new SampleAsyncTask(null, null);
            });

            var dummyCallback = new Action<AsyncTask>((task) =>
            {
                // Dummy callback method that does not do anything.
            });

            Assert.Throws<ArgumentNullException>(() =>
            {
                // Exception is thrown regardless of the second parameter.
                var task = new SampleAsyncTask(null, dummyCallback);
            });
        }