using System.Net.Http.Headers; using System.Text; using Elsa.Http.ContentWriters; using Xunit; namespace Elsa.Http.UnitTests.ContentWriters; /// /// Tests for the class. /// public class RawStringContentTests { /// /// Tests that the content type is set exactly as provided without appending charset information. /// [Fact] public void ContentType_ShouldNotAppendCharset() { // Arrange const string contentType = "text/xml"; const string content = "test"; // Act var rawContent = new RawStringContent(content, Encoding.UTF8, contentType); // Assert Assert.Equal(contentType, rawContent.Headers.ContentType?.MediaType); Assert.Null(rawContent.Headers.ContentType?.CharSet); } }