コード例 #1
0
ファイル: CommitTest.cs プロジェクト: maracuda/Treller
        public void TestParseFromBranchNameSuccessfully(string title, string toBranch)
        {
            var commit = GenerateCommit(title);
            var actual = commit.ParseFromBranchName();

            Assert.True(actual.HasValue);
            Assert.AreEqual(toBranch, actual.Value);
        }
コード例 #2
0
        public void ItCanLoadOnlyCardUpdateActions()
        {
            var actions = trelloClient.GetCardUpdateActions("HVOEKgf7");

            Assert.True(actions.Length > 0);
            Assert.AreEqual(actions.Count(a => a.Type == ActionType.CreateCard), 1);
            Assert.True(actions.Count(a => a.Type == ActionType.UpdateCard) > 0);
        }
コード例 #3
0
ファイル: CommitTest.cs プロジェクト: maracuda/Treller
        public void TestIsMerge(string title, string fromBranch, string toBranch)
        {
            var commit = GenerateCommit(title);

            Assert.True(commit.IsMerge());
            Assert.True(commit.IsMerge(fromBranch, toBranch));
            Assert.True(commit.IsMerge(toBranch));
        }
コード例 #4
0
        public void TestReadAllCardsForBoard()
        {
            var actualBoards = trelloClient.GetAllBoards(testOrgId);
            var firstBoard   = actualBoards.First();
            var boardCards   = trelloClient.GetBoardCardsAsync(new[] { firstBoard.Id }).Result;

            Assert.True(boardCards.Length > 1);
        }
コード例 #5
0
        public void TestReadListsForBoard()
        {
            var actualBoards = trelloClient.GetAllBoards(testOrgId);
            var firstBoard   = actualBoards.First();
            var boardLists   = trelloClient.GetBoardLists(firstBoard.Id);

            Assert.True(boardLists.Length >= 1);

            Console.WriteLine(actualBoards.Stringify());
            Console.WriteLine(boardLists.Stringify());
        }
コード例 #6
0
        public void TestGetAllBoards()
        {
            var actualBoards = trelloClient.GetAllBoards(testOrgId);

            Assert.True(actualBoards.Length > 2);
            var actualOpenBoards = trelloClient.GetOpenBoards(testOrgId);
            var query1           = actualBoards.Select(x => x.Name);
            var query2           = actualOpenBoards.Select(x => x.Name);

            Assert.True(query2.All(i => query1.Contains(i)));
        }
コード例 #7
0
        public void AbleToFindLastCommitAtBranch()
        {
            var lastCommits = gitlabClient.SelectLastCommits("release", 1, 100);

            Assert.True(lastCommits.Length == 100);
            var lastCommit = lastCommits.First();

            Assert.IsNotNull(lastCommit.Id);
            Assert.IsNotNull(lastCommit.Short_id);
            Assert.IsNotNull(lastCommit.Title);
            Assert.IsNotNull(lastCommit.Message);
            Assert.IsNotNull(lastCommit.Author_email);
            Assert.IsNotNull(lastCommit.Author_name);
            Assert.IsNotNull(lastCommit.Created_at);
        }
コード例 #8
0
        public void AbleToSelectBranches()
        {
            var allBranches = gitlabClient.SelectAllBranches();

            Assert.True(allBranches.Length > 2);
            var releaseBranch = allBranches.FirstOrDefault(x => x.Name == "release");

            Assert.IsNotNull(releaseBranch);
            Assert.IsNotNull(releaseBranch.Commit);
            Assert.IsNotNull(releaseBranch.Commit.Id);
            Assert.IsNotNull(releaseBranch.Commit.Message);
            Assert.IsNotNull(releaseBranch.Commit.Committer_name);
            Assert.IsNotNull(releaseBranch.Commit.Committer_email);
            Assert.IsNotNull(releaseBranch.Commit.Committed_date);
        }
コード例 #9
0
        public void TestRunEnumerationOperationWithException()
        {
            var oldTimestamp = 1234L;
            var ex           = new Exception();

            var i           = 0;
            var enumeration = new Func <long, long>((old) =>
            {
                Assert.AreEqual(oldTimestamp, old);
                throw ex;
            });

            using (mockRepository.Record())
            {
                keyValueStorage.Expect(f => f.Find <long>("zzzTimestamp.json")).Return(oldTimestamp);
            }

            var operation       = new EnumerationOperation(keyValueStorage, "zzz", enumeration, () => 1L);
            var operationResult = operation.Run();

            Assert.True(operationResult.HasValue);
            Assert.AreEqual(ex, operationResult.Value);
        }
コード例 #10
0
        public void ItCanLoadAllCardActions()
        {
            var actions = trelloClient.GetCardActions("9JRBHBaL");

            Assert.True(actions.Length > 0);
        }
コード例 #11
0
 public void TestGetClosedBoard()
 {
     Assert.True(trelloClient.GetAllBoards(testOrgId).Any(x => x.IsClosed));
 }