public void ShouldNotFormatNullBase64String() { var formatter = new Base64LogFormatter(); var logRequest = new CreateLogItemRequest(); var isHandled = formatter.FormatLog(logRequest); isHandled.Should().BeFalse(); }
public void ShouldFormatBase64String() { var formatter = new Base64LogFormatter(); var data = new byte[] { 1, 2, 3 }; var base64 = Convert.ToBase64String(data); var logRequest = new CreateLogItemRequest() { Text = $"{{rp#base64#image/png#{base64}}}" }; var isHandled = formatter.FormatLog(logRequest); isHandled.Should().BeTrue(); logRequest.Attach.Should().NotBeNull(); logRequest.Attach.MimeType.Should().Be("image/png"); logRequest.Attach.Data.Should().BeEquivalentTo(data); }