public void GetTags_ReturnsLimitedTags_WhenLimitSpecified() { var tagResponse = auth.GetTags(new TagQueryParams { Limit = 4, Fields = TagFields.Id }); Assert.AreEqual(4, tagResponse.Tags.Count); }
public void GetTags_ReturnsNull_WhenKeyIsInvalid_AndGhostExceptionsSuppressed(ExceptionLevel exceptionLevel) { auth = new GhostContentAPI(Host, InvalidApiKey) { ExceptionLevel = exceptionLevel }; auth.ExceptionLevel = exceptionLevel; Assert.IsNull(auth.GetTags()); Assert.IsNotNull(auth.LastException); }
public void GetTags_ThrowsException_WhenKeyIsInvalid(ExceptionLevel exceptionLevel) { auth = new GhostContentAPI(Host, InvalidApiKey) { ExceptionLevel = exceptionLevel }; var ex = Assert.Throws <GhostSharpException>(() => auth.GetTags()); Assert.IsNotEmpty(ex.Errors); Assert.AreEqual("Unknown Content API Key", ex.Errors[0].Message); }
public void GetTags_ReturnsMatchingPosts() { SetupMockTag(); var response = auth.GetTags().Tags[0]; Assert.AreEqual(id, response.Id); Assert.AreEqual(name, response.Name); Assert.AreEqual(slug, response.Slug); }