public async Task TestThatMutationSubmitNewTopicWithInValidAuthorIdReturnsError() { string topicTitle = "test title"; string topicDescription = "test description"; TopicsResponseOnError parsedResponse = await Server.CreateTopic <TopicsResponseOnError>(Guid.Empty, topicTitle, topicDescription); Assert.IsNotNull(parsedResponse?.Data?.SubmitTopic?.ErrorMessage, "No error message returned"); }
public async Task TestThatMutationRevokeTopicWithInvalidTopicIdReturnsError() { string query = $@"mutation {{ revokeTopic(authorId: ""{Guid.Empty}"" topicId: ""{Guid.Empty}""){{ ... on Error {{ errorMessage }} }} }}"; HttpResponseMessage response = await Server.PostGraphqlQuery(query); response.EnsureSuccessStatusCode(); string responseString = response.Content.ReadAsStringAsync().GetAwaiter().GetResult(); TopicsResponseOnError parsedResponse = JsonConvert.DeserializeObject <TopicsResponseOnError>(responseString); Assert.IsNotNull(parsedResponse?.Data?.RevokeTopic?.ErrorMessage, "No error message returned"); }