public void Constructor1_AcceptsEmptyList() { MediaTypeFormatterCollection collection = new MediaTypeFormatterCollection(new MediaTypeFormatter[0]); Assert.Equal(0, collection.Count); }
public void IsTypeExcludedFromValidation_ReturnsTrueForExcludedTypes(Type type) { Assert.True(MediaTypeFormatterCollection.IsTypeExcludedFromValidation(type)); }
public void FormUrlEncodedFormatter_ClearedByCtor() { MediaTypeFormatterCollection collection = new MediaTypeFormatterCollection(new MediaTypeFormatter[0]); Assert.Null(collection.FormUrlEncodedFormatter); }
public void FindWriter_ThrowsOnNullMediaType() { MediaTypeFormatterCollection collection = new MediaTypeFormatterCollection(); Assert.ThrowsArgumentNull(() => collection.FindWriter(type: typeof(object), mediaType: null), "mediaType"); }
public void JsonFormatterClearedByCtor() { MediaTypeFormatterCollection collection = new MediaTypeFormatterCollection(new MediaTypeFormatter[0]); Assert.Null(collection.JsonFormatter); }