public void AddUriPathExtensionMapping_MediaType_UpdatesMediaTypeMappingsCollection() { MediaTypeFormatter mockFormatter = new Mock<MediaTypeFormatter> { CallBase = true }.Object; mockFormatter.AddUriPathExtensionMapping("ext", "application/test"); Assert.Equal(1, mockFormatter.MediaTypeMappings.Count); Assert.IsType(typeof(UriPathExtensionMapping), mockFormatter.MediaTypeMappings[0]); Assert.Equal("ext", (mockFormatter.MediaTypeMappings[0] as UriPathExtensionMapping).UriPathExtension); Assert.Equal("application/test", (mockFormatter.MediaTypeMappings[0] as UriPathExtensionMapping).MediaType.MediaType); }
public void AddUriPathExtensionMapping_MediaType_UpdatesMediaTypeMappingsCollection() { MediaTypeFormatter mockFormatter = new Mock <MediaTypeFormatter> { CallBase = true }.Object; mockFormatter.AddUriPathExtensionMapping("ext", "application/test"); Assert.Equal(1, mockFormatter.MediaTypeMappings.Count); Assert.IsType(typeof(UriPathExtensionMapping), mockFormatter.MediaTypeMappings[0]); Assert.Equal("ext", (mockFormatter.MediaTypeMappings[0] as UriPathExtensionMapping).UriPathExtension); Assert.Equal("application/test", (mockFormatter.MediaTypeMappings[0] as UriPathExtensionMapping).MediaType.MediaType); }
public void AddUriPathExtensionMapping_MediaType_UpdatesMediaTypeMappingsCollection() { MediaTypeFormatter mockFormatter = new Mock <MediaTypeFormatter> { CallBase = true }.Object; mockFormatter.AddUriPathExtensionMapping("ext", "application/test"); MediaTypeMapping mediaTypeMapping = Assert.Single(mockFormatter.MediaTypeMappings); UriPathExtensionMapping uriPathExtensionMapping = Assert.IsType <UriPathExtensionMapping>(mediaTypeMapping); Assert.Equal("ext", uriPathExtensionMapping.UriPathExtension); Assert.Equal("application/test", uriPathExtensionMapping.MediaType.MediaType); }