public void TestConversionValidBase64String_ShouldConvert() { var converter = new Base64ImageStringToFileConverter(); var data = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//" + "8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="; var file = converter.ConvertToFile(data); Assert.IsNotNull(file.Content); }
public void TestConversionInValidBase64String_ShouldReturnNull() { var file = _converter.ConvertToFile("invalid string"); Assert.IsNull(file); }