public void MimeTypesValidatorShouldReturnCorrectJson(string message, MimeTypeRestriction val, MimeTypeRestriction val2) { //Arrange var validator = new MimeTypeValidator(new[] { val, val2 }, message); //Act var created = validator.CreateValidator(); var json = JsonConvert.SerializeObject(created); //Assert Assert.Equal($@"{{""linkMimetypeGroup"":[""{val.ToString().ToLower()}"",""{val2.ToString().ToLower()}""],""message"":""{message}""}}", json); }
/// <summary> /// Adds a restriction parameter for what mimetypes should be returned by the query. /// </summary> /// <param name="mimetype">The mimetype to filter by.</param> /// <returns>The <see cref="QueryBuilder{T}"/> instance.</returns> public QueryBuilder <T> MimeTypeIs(MimeTypeRestriction mimetype) { _querystringValues.Add(new KeyValuePair <string, string>("mimetype_group", $"{mimetype.ToString().ToLower()}")); return(this); }