public void Should_Encode_String() { // Arrange var xe = new XorEncoder(0x89); var message = "test_string"; var expected = "/ez6/db6/fvg5+4="; // Act var encodedMessage = xe.Encode(message); // Assert Assert.True(string.Equals(encodedMessage, expected), $"Expected: {expected}; Actual: {encodedMessage}"); }
public void Should_Encode_And_Decode_String() { // Arrange var xe = new XorEncoder(0x13); var message = "encrypt_and_decrypt"; // Act var encodedMessage = xe.Encode(message); var decodedMessage = xe.Decode(encodedMessage); // Assert Assert.True(string.Equals(decodedMessage, message), $"Expected: {message}; Actual: {decodedMessage}"); }