Files
mono/mcs/class/System.ServiceModel/Test/FeatureBased/Features.Serialization/AsyncCallTest.cs
T
Atsushi Eno a44a52a067 2010-04-21 Atsushi Enomoto <[email protected]>
* AsyncCallTest.cs : disable it again, it somehow does not work with
	  the latest code from trunk (ThreadPool?).


svn path=/trunk/mcs/; revision=155860
2010-04-21 10:54:55 +00:00

52 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using Proxy.MonoTests.Features.Client;
using MonoTests.Features.Contracts;
using System.Threading;
namespace MonoTests.Features.Serialization
{
[TestFixture]
public class AsyncCallTest : TestFixtureBase<AsyncCallTesterContractClient, AsyncCallTester, MonoTests.Features.Contracts.IAsyncCallTesterContract>
{
bool client_QueryCompleted;
string s = string.Empty;
AutoResetEvent ev;
Exception err = null;
public AsyncCallTest()
{
}
[Test]
[Category ("NotWorking")]
public void TestAsyncCall ()
{
ev = new AutoResetEvent(false);
client_QueryCompleted = false;
ClientProxy.QueryCompleted += new EventHandler<QueryCompletedEventArgs>(Client_QueryCompleted);
ClientProxy.QueryAsync ("heh");
ev.WaitOne(2000, true);
Assert.IsTrue(client_QueryCompleted, "async call completed");
Assert.AreEqual("hehheh", s, "#1");
if (err != null) throw err;
}
private void Client_QueryCompleted (object sender, QueryCompletedEventArgs e)
{
client_QueryCompleted = true;
try
{
s = e.Result;
}
catch (Exception _e)
{
err = _e;
}
ev.Set();
}
}
}