Exemplo n.º 1
0
        public async Task Board_GetAllForCurrent_CustomOptions()
        {
            var config  = new Connection(new Configuration());
            var glo     = new GloClient(config);
            var options = new ApiOptions
            {
                Page     = 1,
                PerPage  = 15,
                Archived = false,
                SortPage = ApiOptions.Sort.Desc
            };

            var boards = await glo.Board.GetAllForCurrent(options);

            // I know this is an arbitrary test but this will allow us to see
            // if the test is pulling information down with the PAT provided.
            // It also let's us check to make sure it returns in a list :)
            // To make sure they are running right, you can check the different out
            // puts from the above test. They should sort in a different order.
            foreach (var board in boards)
            {
                _testOutputHelper.WriteLine($"ID: {board.Id}");
                _testOutputHelper.WriteLine($"Name: {board.Name}");
                Assert.Equal(board.Name, board.Name);
            }
        }
Exemplo n.º 2
0
        public async Task User_GetPartialForCurrent()
        {
            var config      = new Connection(new Configuration());
            var glo         = new GloClient(config);
            var partialUser = await glo.User.GetPartialForCurrent();

            _testOutputHelper.WriteLine($"ID: {partialUser.Id}");
            _testOutputHelper.WriteLine($"Username: {partialUser.Username}");

            Assert.NotNull(partialUser.Username);
            Assert.NotNull(partialUser.Username);
        }
Exemplo n.º 3
0
        public async Task Card_GetAllForCurrent()
        {
            var config = new Connection(new Configuration());
            var glo    = new GloClient(config);

            var allCards = await glo.Card.GetAll();

            _testOutputHelper.WriteLine($"Cards Found: {allCards.Count}");
            foreach (var card in allCards)
            {
                _testOutputHelper.WriteLine($"Card Id: {card.Id} | Card Name: {card.Name} | Board Id: {card.BoardId}");
                Assert.NotNull(card.Id);
                Assert.NotNull(card.Name);
            }
        }
Exemplo n.º 4
0
        public async Task Board_GetAllForSingle_DefaultOptions()
        {
            // want to figure out a way to get this to auto do this when you just
            // new up a GloClient
            var glo    = new GloClient(new Connection(new Configuration()));
            var boards = glo.Board.GetAllForCurrent().Result.FirstOrDefault();
            var board  = await glo.Board.GetAllForSingle(boards?.Id);

            _testOutputHelper.WriteLine($"ID: {board.Id}");
            _testOutputHelper.WriteLine($"Name: {board.Name}");
            _testOutputHelper.WriteLine($"Created Date: {board.CreatedDate}");

            Assert.NotNull(board.Id);
            Assert.NotNull(board.Name);
            Assert.NotNull(board.CreatedDate);
        }
Exemplo n.º 5
0
        public async Task Card_GetAllForCurrentBoard()
        {
            var config = new Connection(new Configuration());
            var glo    = new GloClient(config);
            var boards = await glo.Board.GetAllForCurrent();

            var boardId = boards.FirstOrDefault()?.Id;
            var cards   = await glo.Card.GetAll(boardId);

            foreach (var card in cards)
            {
                _testOutputHelper.WriteLine($"Card Id: {card.Id} | Card Name: {card.Name}");

                Assert.NotNull(card.Id);
                Assert.NotNull(card.Name);
            }
        }
Exemplo n.º 6
0
        public async Task Board_GetAllForCurrent_DefaultOptions()
        {
            var config = new Connection(new Configuration());
            var glo    = new GloClient(config);

            var boards = await glo.Board.GetAllForCurrent();

            // I know this is an arbitrary test but this will allow us to see
            // if the test is pulling information down with the PAT provided.
            // It also let's us check to make sure it returns in a list :)
            foreach (var board in boards)
            {
                _testOutputHelper.WriteLine($"ID: {board.Id}");
                _testOutputHelper.WriteLine($"Name: {board.Name}");
                Assert.Equal(board.Name, board.Name);
            }
        }
Exemplo n.º 7
0
        public async Task User_GetAllForCurrent()
        {
            // want to figure out a way to get this to auto do this when you just
            // new up a GloClient
            var config = new Connection(new Configuration());
            var glo    = new GloClient(config);
            var user   = await glo.User.GetAllForCurrent();

            _testOutputHelper.WriteLine($"ID: {user.Id}");
            _testOutputHelper.WriteLine($"Name: {user.Name}");
            _testOutputHelper.WriteLine($"Username: {user.Username}");
            _testOutputHelper.WriteLine($"Email: {user.Email}");

            // Test to make sure all fields return a value.
            Assert.NotNull(user.Id);
            Assert.NotNull(user.Name);
            Assert.NotNull(user.Username);
            Assert.NotNull(user.Email);
        }
Exemplo n.º 8
0
        public async Task Card_GetAllAssignedForUser()
        {
            var config = new Connection(new Configuration());
            var glo    = new GloClient(config);
            var boards = await glo.Board.GetAllForCurrent();

            var user = await glo.User.GetAllForCurrent();

            var allCards = await glo.Card.GetAllAssigned(boards, user);

            var assignedCards = (
                from card
                in allCards let assignees = card.Assignees
                                            from assignee in assignees
                                            where assignee.Id == user.Id select card).ToList();

            foreach (var card in assignedCards)
            {
                _testOutputHelper.WriteLine($"ID: {card.Id} | Name: {card.Name}");
            }
            Assert.NotNull(assignedCards);
        }