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.2.1.12 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.2.1.11 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.2.1.10 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.2.1.9 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.2.1.8 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.2.1.7 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.2.1.6 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.2.1.5 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.2.1.4 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.2.1.3 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.2.1.2 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.2.1.1 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.2.1.0 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.2.0.6 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.2.0.5 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.2.0.4 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.2.0.3 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.2.0.2 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.2.0.1 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.2.0.0 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs