Skip to content

Commit 5809730

Browse files
author
mtu
committed
2 parents 9f1edbf + c75dbb6 commit 5809730

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/Yaapii.Atoms/Text/TextBase64.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public sealed class TextBase64 : TextEnvelope
3434
/// A <see cref="string"/> as Base64-Encoded <see cref="IText"/>
3535
/// </summary>
3636
/// <param name="str">string to encode</param>
37-
public TextBase64(String str) : base(() => str, false)
37+
public TextBase64(String str) : this(new LiveText(str))
3838
{ }
3939

4040
/// <summary>

tests/Yaapii.Atoms.Tests/Text/TextBase64Tests.cs

+18
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,23 @@ public void EncodesText(string text)
6464
);
6565
}
6666
}
67+
68+
[Theory]
69+
[InlineData("A fancy text")]
70+
[InlineData("A fancy text with \n line break")]
71+
[InlineData("A fancy text with € special character")]
72+
public void EncodesString(string text)
73+
{
74+
Assert.Equal(
75+
new LiveText(
76+
new BytesBase64(
77+
new BytesOf(
78+
new LiveText(text)
79+
)
80+
)
81+
).AsString(),
82+
new TextBase64(text).AsString()
83+
);
84+
}
6785
}
6886
}

0 commit comments

Comments
 (0)