How set EnqueueCallBack to my generic callback

Posted by CrazyJoe on Stack Overflow See other posts from Stack Overflow or by CrazyJoe
Published on 2010-04-12T12:58:21Z Indexed on 2010/04/12 14:43 UTC
Read the original article Hit count: 630

using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsistec.Domain;
using Microsistec.Client;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;
using Microsistec.Tools;
using System.Json;
using Microsistec.SystemConfig;
using System.Threading;
using Microsoft.Silverlight.Testing;

namespace Test
{

    [TestClass]
    public class SampleTest : SilverlightTest
    {

        [TestMethod, Asynchronous]
        public void login()
        {

            List<PostData> data = new List<PostData>();
            data.Add(new PostData("email", "xxx"));
            data.Add(new PostData("password", MD5.GetHashString("xxx")));
            WebClient.sendData(Config.DataServerURL + "/user/login", data, LoginCallBack);
            EnqueueCallback(?????????);
            EnqueueTestComplete();
        }

        [Asynchronous]
        public void LoginCallBack(object sender, System.Net.UploadStringCompletedEventArgs e)
        {
            string json = Microsistec.Client.WebClient.ProcessResult(e);
            var result = JsonArray.Parse(json);
            Assert.Equals("1", result["value"].ToString());
            TestComplete();
        }
    }

Im tring to set ???????? value but my callback is generic, it is setup on my WebClient .SendData, how i implement my EnqueueCallback to a my already functio LoginCallBack???

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about unit-testing