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.55 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.54 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.53 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.52 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.51 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.50 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.49 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.48 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.47 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.46 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.45 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.44 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.43 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.42 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.41 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.40 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.39 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.38 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.37 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs
trackler-2.1.0.36 tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs