예제 #1
0
 public bool Initialize(string accountName, string emailAddress, string password)
 {
     try
     {
         var lkFactory = new LeanKitClientFactory();
         var lkAuth    = new LeanKitBasicAuth
         {
             Hostname = accountName,
             Username = emailAddress,
             Password = password
         };
         _api = lkFactory.Create(lkAuth);
         // Test authentication
         var boards = _api.GetBoards();
         if (boards == null)
         {
             return(false);
         }
         _cache.Set("boards", boards.ToArray(), DateTimeOffset.Now.AddMinutes(5));
         return(true);
     }
     catch (Exception)
     {
         _api = null;
         return(false);
     }
 }
예제 #2
0
        public virtual ILeanKitApi CreateApi(string hostName, string userName, string password)
        {
            var factory       = new LeanKitClientFactory();
            var authorisation = new LeanKitBasicAuth
            {
                Hostname = hostName,
                Username = userName,
                Password = password
            };

            return(factory.Create(authorisation));
        }
        protected override void OnStartTest()
        {
            var api       = LeanKitClientFactory.Create(new LeanKitAccountAuth());
            var eventArgs = new BoardChangedEventArgs
            {
                UpdatedCards = new List <CardUpdateEvent> {
                    CardUpdateEvent
                }
            };

            TestItem.SimulateUpdateEvent(BoardId, eventArgs, api);
        }