public async Task Given_Parameter_When_Instantiated_Should_HaveContent() { var contentType = "text/plain"; var data = "hello world"; var ce = new AnotherFakeEvent(); ce.EventType = "com.example.someevent"; ce.Source = (new Uri("http://localhost")).ToString(); ce.EventId = Guid.NewGuid().ToString(); ce.ContentType = contentType; ce.Data = data; var content = new BinaryCloudEventContent <string>(ce); var result = await content.ReadAsStringAsync().ConfigureAwait(false); result.Should().Be(data); }
public void Given_Parameter_When_Instantiated_Should_HaveContentType() { var contentType = "text/plain"; var charset = "utf-8"; var data = "hello world"; var ce = new AnotherFakeEvent(); ce.EventType = "com.example.someevent"; ce.Source = (new Uri("http://localhost")).ToString(); ce.EventId = Guid.NewGuid().ToString(); ce.ContentType = contentType; ce.Data = data; var content = new BinaryCloudEventContent <string>(ce); content.Headers.ContentType.MediaType.Should().Be(contentType); content.Headers.ContentType.CharSet.Should().Be(charset); }