public void DecodeWith1Param_GivenStringIsNullOrEmpty_ReturnsSpecifiedString() { var decoder = new MyDecoder(string.Empty); var specifiedString = "The string is empty"; Assert.IsTrue(decoder.Decode(null) == specifiedString && decoder.Decode(string.Empty) == specifiedString); }
public void LoadImage(string path) { decoder = new MyDecoder(path); imgOriginal = decoder.Decode(); OriginalDrawer?.Invoke(imgOriginal); filters = new Filterer(imgOriginal); }
public void DecodeWithNoParams_StringToDecodeIsNullOrEmpty_ReturnsSpecifiedString() { var decoder1 = new MyDecoder(null); var decoder2 = new MyDecoder(string.Empty); var specifiedString = "The string is empty"; Assert.IsTrue(decoder1.Decode() == specifiedString && decoder2.Decode() == specifiedString); }
public void DecodeWithNoParams_StringToDecodeHasValue_ReturnsDecodedString() { var decoder = new MyDecoder("2[abc]d3[a]"); var expected = "abcabcdaaa"; var result = decoder.Decode(); Assert.IsTrue(expected == result); }
public void DecodeWith1Param_GivenStringIsValidString_ReturnsDecodedString() { var decoder = new MyDecoder(""); var givenString = "2[abc3[f]]"; var expected = "abcfffabcfff"; var result = decoder.Decode(givenString); Assert.IsTrue(expected == result); }
void Decode(byte[] bytes) { int size = sizeof(int); byte[] encodedLengthBytes = bytes.Take(size).ToArray(); byte[] encodedAudioBytes = bytes.Skip(sizeof(int)).Take(bytes.Length - sizeof(int)).ToArray(); int length = DecodeLength(encodedLengthBytes); decoder.Decode(encodedAudioBytes, length); }
private void UserInputText_TextChanged(object sender, EventArgs e) { this.ResultLable.Text = decoder.Decode(this.UserInputText.Text); }