Пример #1
0
        public async Task CleanUpLeftOverTestRuns()
        {
            var factory = new TrelloFactory();
            var me      = await factory.Me();

            await me.Refresh();

            await Task.WhenAll(me.Boards.Where(b => b.Name.StartsWith("TestBoard_")).Select(async b =>
            {
                Console.WriteLine($"Deleting board {b}");
                await b.Delete();
            }));

            await Task.WhenAll(me.Boards.Where(b => b.Name.StartsWith("changed")).Select(async b =>
            {
                Console.WriteLine($"Deleting board {b}");
                await b.Delete();
            }));

            await Task.WhenAll(me.Organizations.Where(o => o.DisplayName.StartsWith("TestOrg_")).Select(async o =>
            {
                Console.WriteLine($"Deleting org {o}");
                await o.Delete();
            }));
        }
Пример #2
0
        public async Task <List <TrelloBoard> > FindAll()
        {
            var ret = new List <TrelloBoard>();

            try
            {
                var auth = new TrelloAuthorization
                {
                    AppKey    = _appKey,
                    UserToken = _userToken
                };

                var factory = new TrelloFactory();

                var me = await factory.Me().ConfigureAwait(true);


                foreach (var board in me.Boards)
                {
                    var t = new TrelloBoard
                    {
                        name = board.Name
                    };
                    ret.Add(t);
                }
            }
            catch (TrelloInteractionException e)
            {
                var msg = e.Message;
            }
            return(ret);
        }
Пример #3
0
        public async Task Issue34_CardsNotDownloading()
        {
            //app key and token, user required to enter token
            TrelloAuthorization.Default.AppKey    = "440a184b181002cf00f63713a7f51191";
            TrelloAuthorization.Default.UserToken = "dfd8dd877fa1775db502f891370fb26882a4d8bad41a1cc8cf1a58874b21322b";

            TrelloConfiguration.ThrowOnTrelloError = true;

            Console.WriteLine(await _factory.Me());
            var boardID = "574e95edd8a4fc16207f7079";
            var board   = _factory.Board(boardID);

            Console.WriteLine(board);

            //here is where it calls the exception with 'invalid id'
            foreach (var card in board.Cards)
            {
                Console.WriteLine(card);
            }
        }
Пример #4
0
        public async Task TestMethod1()
        {
            await Run(async ct =>
            {
                var me = await _factory.Me(ct);
                await me.BoardBackgrounds.Refresh(true, ct);
                OutputCollection("backgrounds", me.BoardBackgrounds);

                var data          = File.ReadAllBytes("C:\\Users\\gregs\\OneDrive\\Public\\Manatee Open-Source (shadow).png");
                var newBackground = await me.BoardBackgrounds.Add(data, ct);

                Console.WriteLine(newBackground);

                await newBackground.Delete(ct);
            });
        }
Пример #5
0
        public async Task Run()
        {
            IBoard board = null;

            try
            {
                var me = await _factory.Me();

                board = await me.Boards.Add($"TestBoard{Guid.NewGuid()}");
            }
            finally
            {
                board?.Delete();

                await TrelloProcessor.Flush();
            }
        }
        public async Task BuildEnvironment()
        {
            if (Current != null)
            {
                throw new InvalidOperationException("Test setup occurring twice...");
            }

            if (File.Exists("Manatee.Trello.run"))
            {
                File.Delete("Manatee.Trello.run");
            }

            Current = this;

            EnsureLicense();

            TrelloAuthorization.Default.AppKey    = TrelloIds.AppKey;
            TrelloAuthorization.Default.UserToken = _GetUserToken();

            TrelloConfiguration.RestClientProvider =
                new CapturingClientProvider(TrelloConfiguration.RestClientProvider,
                                            r => LastRequest  = r,
                                            r => LastResponse = r);
            TrelloConfiguration.Log = new LocalOnlyConsoleLog();

            var testTimeStamp = $"{DateTime.Now:yyMMddHHmmss}";

            Factory = new TrelloFactory();
            Me      = await Factory.Me();

            Organization = await Me.Organizations.Add($"TestOrg_{testTimeStamp}");

            Board = await Organization.Boards.Add($"TestBoard_{testTimeStamp}");

            await Organization.Refresh();

            await Board.Refresh();
        }