Sha256: 3097813d6dd42b6da0c872852971ac6f827d67237805e0828a6f0bdc1ca5982e
Contents?: true
Size: 1.83 KB
Versions: 115
Compression:
Stored size: 1.83 KB
Contents
using Xunit; public class RunLengthEncodingTest { [Fact] public void Encode_simple() { const string input = "AABBBCCCC"; const string expected = "2A3B4C"; Assert.Equal(expected, RunLengthEncoding.Encode(input)); } [Fact(Skip = "Remove to run test")] public void Decode_simple() { const string input = "2A3B4C"; const string expected = "AABBBCCCC"; Assert.Equal(expected, RunLengthEncoding.Decode(input)); } [Fact(Skip = "Remove to run test")] public void Encode_with_single_values() { const string input = "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"; const string expected = "12WB12W3B24WB"; Assert.Equal(expected, RunLengthEncoding.Encode(input)); } [Fact(Skip = "Remove to run test")] public void Decode_with_single_values() { const string input = "12WB12W3B24WB"; const string expected = "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"; Assert.Equal(expected, RunLengthEncoding.Decode(input)); } [Fact(Skip = "Remove to run test")] public void Encode_and_then_decode() { const string input = "zzz ZZ zZ"; const string expected = "zzz ZZ zZ"; Assert.Equal(expected, RunLengthEncoding.Decode(RunLengthEncoding.Encode(input))); } [Fact(Skip = "Remove to run test")] public void Encode_unicode() { const string input = "⏰⚽⚽⚽⭐⭐⏰"; const string expected = "⏰3⚽2⭐⏰"; Assert.Equal(expected, RunLengthEncoding.Encode(input)); } [Fact(Skip = "Remove to run test")] public void Decode_unicode() { const string input = "⏰3⚽2⭐⏰"; const string expected = "⏰⚽⚽⚽⭐⭐⏰"; Assert.Equal(expected, RunLengthEncoding.Decode(input)); } }
Version data entries
115 entries across 115 versions & 1 rubygems