コード例 #1
0
ファイル: WikiMethodsTest.cs プロジェクト: ats124/backlog4net
        public async Task WikiTest()
        {
            var wiki = await client.CreateWikiAsync(new CreateWikiParams(projectId, "TestName", "TestContent")
            {
                MailNotify = false,
            });

            Assert.AreEqual(wiki.ProjectId, projectId);
            Assert.AreNotEqual(wiki.Id, 0);
            Assert.AreEqual(wiki.Name, "TestName");
            Assert.AreEqual(wiki.Content, "TestContent");

            var wikiGet = await client.GetWikiAsync(wiki.Id);

            Assert.AreEqual(wikiGet.Id, wiki.Id);
            Assert.AreEqual(wikiGet.Name, "TestName");
            Assert.AreEqual(wikiGet.Content, "TestContent");

            var wikiUpdated = await client.UpdateWikiAsync(new UpdateWikiParams(wiki.Id)
            {
                Name       = "TestNameUpdated",
                Content    = "TestContentUpdated",
                MailNotify = false,
            });

            Assert.AreEqual(wikiUpdated.Id, wiki.Id);
            Assert.AreEqual(wikiUpdated.Name, "TestNameUpdated");
            Assert.AreEqual(wikiUpdated.Content, "TestContentUpdated");

            var wikiDeleted = await client.DeleteWikiAsync(wiki.Id, false);

            Assert.AreEqual(wikiDeleted.Id, wiki.Id);
            Assert.AreEqual(wikiDeleted.Name, "TestNameUpdated");
            Assert.AreEqual(wikiDeleted.Content, "TestContentUpdated");
        }
コード例 #2
0
ファイル: StarMethodsTest.cs プロジェクト: ats124/backlog4net
        public async Task AddStarToWikiTestAsync()
        {
            var wiki = await client.CreateWikiAsync(new CreateWikiParams(projectId, "StarTest", "StarTestContent")
            {
                MailNotify = false,
            });

            await client.AddStarToWikiAsync(wiki.Id);

            await client.DeleteWikiAsync(wiki.Id, false);
        }
コード例 #3
0
        public async Task ImportWikiTestAsync()
        {
            var wiki = await client.ImportWikiAsync(new ImportWikiParams(projectId, "ImportWikiTest", "ImportWikiTestContent")
            {
                CreatedUserId = anotherUser.Id,
                Created       = new DateTime(2017, 8, 1, 10, 5, 10, DateTimeKind.Utc),
                UpdatedUserId = anotherUser.Id,
                Updated       = new DateTime(2017, 8, 2, 10, 5, 10, DateTimeKind.Utc),
            });

            Assert.AreEqual(wiki.CreatedUser.Id, anotherUser.Id);
            Assert.AreEqual(wiki.Created, new DateTime(2017, 8, 1, 10, 5, 10, DateTimeKind.Utc));

            await client.DeleteWikiAsync(wiki.Id, false);
        }