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"); }
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); }
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); }