public async Task WriteAsync_Sets406NotAcceptable()
        {
            // Arrange
            var formatter = new HttpNotAcceptableOutputFormatter();

            var context = new OutputFormatterWriteContext(
                new DefaultHttpContext(),
                new TestHttpResponseStreamWriterFactory().CreateWriter,
                objectType: null,
                @object: null);

            // Act
             await formatter.WriteAsync(context);

            // Assert
            Assert.Equal(StatusCodes.Status406NotAcceptable, context.HttpContext.Response.StatusCode);
        }
        public void CanWriteResult_ReturnsTrue_WhenConnegHasFailed()
        {
            // Arrange
            var formatter = new HttpNotAcceptableOutputFormatter();

            var context = new OutputFormatterWriteContext(
                new DefaultHttpContext(),
                new TestHttpResponseStreamWriterFactory().CreateWriter,
                objectType: null,
                @object: null)
            {
                FailedContentNegotiation = true,
            };

            // Act
            var result = formatter.CanWriteResult(context);

            // Assert
            Assert.True(result);
        }