public void Can_remove_by_mediatype()
        {
            // Arrange
            var mediaType  = new HealthMediaTypeValue("text", "vnd.appmetrics.health", "v1", "plain");
            var formatters = new HealthFormatterCollection(
                new List <IHealthOutputFormatter> {
                new HealthStatusTextOutputFormatter()
            });

            // Act
            formatters.RemoveType(mediaType);

            // Assert
            formatters.Count.Should().Be(0);
        }
        public void Returns_default_when_attempting_to_get_type_with_mediatype_not_added()
        {
            // Arrange
            var mediaType  = new HealthMediaTypeValue("text", "vnd.appmetrics.health", "v1", "plain");
            var formatters =
                new HealthFormatterCollection
            {
                new HealthStatusJsonOutputFormatter()
            };

            // Act
            var formatter = formatters.GetType(mediaType);

            // Assert
            formatter.Should().BeNull();
        }
        public void Can_get_by_mediatype()
        {
            // Arrange
            var mediaType  = new HealthMediaTypeValue("application", "vnd.appmetrics.health", "v1", "json");
            var formatters =
                new HealthFormatterCollection
            {
                new HealthStatusTextOutputFormatter(),
                new HealthStatusJsonOutputFormatter()
            };

            // Act
            var formatter = formatters.GetType(mediaType);

            // Assert
            formatter.Should().NotBeNull();
            formatter.Should().BeOfType <HealthStatusJsonOutputFormatter>();
        }