public void GetDefaultValueForType_ReturnsValueForValueTypes <T>(T value) { Type valueType = value.GetType(); T defaultValue = default(T); Assert.Equal(defaultValue, MediaTypeFormatter.GetDefaultValueForType(valueType)); }
public void GetDefaultValueForType_ReturnsValueForStruct() { TestStruct s = new TestStruct(); TestStruct result = (TestStruct)MediaTypeFormatter.GetDefaultValueForType(typeof(TestStruct)); Assert.Equal(s, result); }
public void GetDefaultValueForType_ReturnsNullForReferenceTypes(Type referenceType) { Assert.Null(MediaTypeFormatter.GetDefaultValueForType(referenceType)); }