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

Version Path
trackler-2.1.0.34 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.33 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.32 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.31 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.30 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.29 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.28 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.27 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.26 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.25 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.24 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.23 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.22 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.21 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.20 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.19 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.18 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.17 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.16 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.15 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs