public void GetEncodedString_CallWithEncodingASCII_ReturnsBytesAsASCIIString() { var bytes = Encoding.Default.GetBytes("ÄÜ"); var value = new Base64Value(bytes, Encoding.Default); Assert.Equal("ÄÜ", value.GetEncodedString()); }
public void GetEncodedString_Call_ReturnsBytesAsString() { var bytes = Encoding.UTF8.GetBytes("Test1234"); var value = new Base64Value(bytes, Encoding.UTF8); Assert.Equal("Test1234", value.GetEncodedString()); }
public void Ctor_BytesData_ValueIsSetCorrect() { var bytes = Encoding.UTF8.GetBytes("Test1234"); var value = new Base64Value(bytes, Encoding.UTF8); Assert.Equal(bytes, value.Value); }
public void Ctor_Base64StringData_ValueIsSetCorrect() { var bytes = Encoding.UTF8.GetBytes("Test1234"); var data = Convert.ToBase64String(bytes); var value = new Base64Value(data, Encoding.UTF8); Assert.Equal(bytes, value.Value); }
public void WriteTo_PassMatchingValue_ValueElementIsWrittenToParamElement() { var writer = new Base64ValueWriter(); var data = Encoding.UTF8.GetBytes("Test1234"); var value = new Base64Value(data, Encoding.UTF8); var xmlElement = new XElement("param"); writer.WriteTo(xmlElement, value); var valueElement = xmlElement.XPathSelectElement("value/base64"); Assert.NotNull(valueElement); Assert.Equal(Convert.ToBase64String(data), valueElement.Value); }