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.3.9 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.3.8 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.3.7 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.3.6 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.3.5 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.3.4 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.3.3 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.3.2 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.3.1 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.3.0 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.2.0 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.1.2 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.1.1 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.1.0 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.0.10 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.0.9 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.0.8 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.0.7 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.0.6 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.0.5 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs