Ejemplo n.º 1
0
        public static void GetZulipClient()
        {
            ZulipServer         ZuSrv  = new ZulipServer(ServerURL);
            ZulipAuthentication ZuAuth = new ZulipAuthentication(UserEmail, UserSecret);

            client = new ZulipClient(ZuSrv, ZuAuth);
        }
Ejemplo n.º 2
0
 public void Setup()
 {
     if (File.Exists(".zuliprc"))
     {
         zclient         = ZulipServer.Login(".zuliprc");
         messageEndpoint = zclient.GetMessageEndPoint();
     }
 }
Ejemplo n.º 3
0
 public static void GetZulipClient(string ZulipRCPath)
 {
     if (!Connected)
     {
         client    = ZulipServer.Login(ZulipRCPath);
         Connected = client != null && !string.IsNullOrEmpty(ApiKey);
     }
 }
Ejemplo n.º 4
0
 public void Setup()
 {
     if (File.Exists(".zuliprc"))
     {
         zclient        = ZulipServer.Login(".zuliprc");
         streamEndpoint = zclient.GetStreamEndPoint();
     }
 }
Ejemplo n.º 5
0
        public async Task ZulipLoginWithEmailAndApiKeyTest(string serverURL, string userEmail, string apiKey)
        {
            var srv       = new ZulipServer(serverURL);
            var client    = srv.Login(userEmail, apiKey);
            var sEndPoint = client.GetStreamEndPoint();
            var streams   = await sEndPoint.GetStreams();

            Assert.IsTrue(streams?.Count > 0);
        }
Ejemplo n.º 6
0
 public async Task Setup()
 {
     if (File.Exists(".zuliprc"))
     {
         zclient      = ZulipServer.Login(".zuliprc");
         userEndpoint = zclient.GetUserEndPoint();
         await RefreshData();
     }
 }
Ejemplo n.º 7
0
 public static void GetZulipClient()
 {
     if (!Connected && !string.IsNullOrEmpty(ApiKey))
     {
         ZulipServer         ZuSrv  = new ZulipServer(ServerURL);
         ZulipAuthentication ZuAuth = new ZulipAuthentication(UserEmail, ApiKey);
         client    = new ZulipClient(ZuSrv, ZuAuth);
         Connected = client != null;
     }
 }
Ejemplo n.º 8
0
        public static async Task GetZulipClient(string userEmail, string password)
        {
            if (!Connected)
            {
                ZulipServer ZuSrv = new ZulipServer(ServerURL);
                client = await ZuSrv.LoginAsync(UserEmail, Password);

                Connected = client != null && !string.IsNullOrEmpty(ApiKey);
            }
        }
Ejemplo n.º 9
0
        public void TestZulipRC()
        {
            var zuliprc = ".zuliprc";
            var apiKey  = "";

            if (File.Exists(zuliprc))
            {
                var zulipClient = ZulipServer.Login(zuliprc);
                apiKey = zulipClient.APIKey;
            }
            Assert.IsTrue(!string.IsNullOrEmpty(apiKey));
        }
Ejemplo n.º 10
0
 public void SetUp()
 {
     Auth   = new ZulipAuthentication("email", "api_token");
     Server = new ZulipServer("https://localhost:9991");
 }