Sha256: 4288d2ba4b50cb9b5df3788513251deab3e6eb418fa5266f8b6e465525983e66

Contents?: true

Size: 1.98 KB

Versions: 115

Compression:

Stored size: 1.98 KB

Contents

using NUnit.Framework;

public class RailFenceCipherTest
{
    [Test]
    public void Encode_with_two_rails()
    {
        var railFenceCipher = new RailFenceCipher(2);
        var actual = railFenceCipher.Encode("XOXOXOXOXOXOXOXOXO");
        var expected = "XXXXXXXXXOOOOOOOOO";
        Assert.That(actual, Is.EqualTo(expected));
    }

    [Ignore("Remove to run test")]
    [Test]
    public void Encode_with_three_rails()
    {
        var railFenceCipher = new RailFenceCipher(3);
        var actual = railFenceCipher.Encode("WEAREDISCOVEREDFLEEATONCE");
        var expected = "WECRLTEERDSOEEFEAOCAIVDEN";
        Assert.That(actual, Is.EqualTo(expected));
    }

    [Ignore("Remove to run test")]
    [Test]
    public void Encode_with_ending_in_the_middle()
    {
        var railFenceCipher = new RailFenceCipher(4);
        var actual = railFenceCipher.Encode("EXERCISES");
        var expected = "ESXIEECSR";
        Assert.That(actual, Is.EqualTo(expected));
    }

    [Ignore("Remove to run test")]
    [Test]
    public void Decode_with_three_rails()
    {
        var railFenceCipher = new RailFenceCipher(3);
        var actual = railFenceCipher.Decode("TEITELHDVLSNHDTISEIIEA");
        var expected = "THEDEVILISINTHEDETAILS";
        Assert.That(actual, Is.EqualTo(expected));
    }

    [Ignore("Remove to run test")]
    [Test]
    public void Decode_with_five_rails()
    {
        var railFenceCipher = new RailFenceCipher(5);
        var actual = railFenceCipher.Decode("EIEXMSMESAORIWSCE");
        var expected = "EXERCISMISAWESOME";
        Assert.That(actual, Is.EqualTo(expected));
    }

    [Ignore("Remove to run test")]
    [Test]
    public void Decode_with_six_rails()
    {
        var railFenceCipher = new RailFenceCipher(6);
        var actual = railFenceCipher.Decode("133714114238148966225439541018335470986172518171757571896261");
        var expected = "112358132134558914423337761098715972584418167651094617711286";
        Assert.That(actual, Is.EqualTo(expected));
    }
}

Version data entries

115 entries across 115 versions & 1 rubygems

Version Path
trackler-2.0.5.18 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.5.17 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.5.16 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.5.15 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.5.14 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.5.13 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.5.12 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.5.11 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.5.10 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.5.9 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.5.8 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.5.7 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.5.6 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.5.5 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.5.4 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.5.3 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.5.2 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.5.1 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.5.0 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.4.0 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs