{
MediaControlServer.CustomCommandReceived += eventHandler;
- await Task.Run(() =>
- {
- var serverResult = controller.RequestCommandAsync(new CustomCommand("Custom"));
- Assert.AreEqual(serverResult.Result.result, (int)result, "Should be same value");
- });
+ var serverResult = await controller.RequestCommandAsync(new CustomCommand("Custom"));
+ Assert.AreEqual(serverResult.result, (int)result, "Should be same value");
}
finally
{
{
MediaControlServer.CustomCommandReceived += eventHandler;
- await Task.Run(() =>
- {
- var serverResult = controller.RequestCommandAsync(new CustomCommand("Custom"));
- Assert.AreEqual(serverResult.Result.result, (int)result, "Should be same value");
- });
+ var serverResult = await controller.RequestCommandAsync(new CustomCommand("Custom"));
+ Assert.AreEqual(serverResult.result, (int)result, "Should be same value");
}
finally
{
{
_controller.CustomCommandReceived += eventHandler;
- await Task.Run(() =>
- {
- var clientResult = MediaControlServer.RequestCommandAsync(new CustomCommand("CustomCommand"),
- Application.Current.ApplicationInfo.ApplicationId);
+ var clientResult = await MediaControlServer.RequestCommandAsync(new CustomCommand("CustomCommand"),
+ Application.Current.ApplicationInfo.ApplicationId);
- Assert.AreEqual(clientResult.Result.result, (int)result, "Should be same value");
- });
+ Assert.AreEqual(clientResult.result, (int)result, "Should be same value");
}
finally
{
{
_controller.CustomCommandReceived += eventHandler;
- await Task.Run(() =>
- {
- var clientResult = MediaControlServer.RequestCommandAsync(new CustomCommand("CustomCommand"),
- Application.Current.ApplicationInfo.ApplicationId);
+ var clientResult = await MediaControlServer.RequestCommandAsync(new CustomCommand("CustomCommand"),
+ Application.Current.ApplicationInfo.ApplicationId);
- Assert.AreEqual(clientResult.Result.result, (int)result, "Should be same value");
- });
+ Assert.AreEqual(clientResult.result, (int)result, "Should be same value");
}
finally
{