public void ThenItShouldReturnTimeStamp()
        {
            Pubnub pubnub = new Pubnub(
                "demo",
                "demo",
                "",
                "",
                false
            );

            bool responseStatus = false;

            string strResponse = "";
            pubnub.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) {
                if (e.PropertyName == "Time") {
                    strResponse = ((Pubnub)sender).Time[0].ToString();

                    responseStatus = true;
                }
            };

            pubnub.time();
            while (!responseStatus);

            Console.WriteLine (strResponse);
            Assert.AreNotEqual("0",strResponse);
        }
예제 #2
0
 public static long Timestamp(Pubnub pubnub)
 {
     deliveryStatus = false;
     pubnub.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e)
     {
         if (e.PropertyName == "Time")
         {
             deliveryStatus = true;
         }
     };
     pubnub.time();
     while (!deliveryStatus) ;
     return Convert.ToInt64(pubnub.Time[0].ToString());
 }