public async Task CreateAndDeletePostTest() { WordPressClient client = await GetAuthenticatedWordPressClient(); var IsValidToken = await client.IsValidJWToken(); Assert.IsTrue(IsValidToken); var newpost = new PostCreate() { Content = "Testcontent" }; var resultPost = await client.CreatePost(newpost); Assert.IsNotNull(resultPost.Id); var del = await client.DeletePost(resultPost.Id); Assert.IsTrue(del.IsSuccessStatusCode); }
public async Task CreateAndDeletePostTest() { var client = new WordPressClient(ApiCredentials.WordPressUri); client.Username = ApiCredentials.Username; client.Password = ApiCredentials.Password; client.AuthMethod = AuthMethod.JWT; await client.RequestJWToken(); var IsValidToken = await client.IsValidJWToken(); Assert.IsTrue(IsValidToken); var newpost = new PostCreate() { Content = "Testcontent" }; var resultPost = await client.CreatePost(newpost); Assert.IsNotNull(resultPost.Id); var del = await client.DeletePost(resultPost.Id); Assert.IsTrue(del.IsSuccessStatusCode); }