Exemplo n.º 1
0
        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");
        }
Exemplo n.º 2
0
        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);
        }