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.8.14 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.8.13 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.8.12 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.8.11 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.8.10 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.8.9 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.8.8 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.8.7 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.8.6 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.8.5 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.8.4 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.8.3 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.8.2 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.8.1 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.7.0 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.6.44 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.6.43 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.6.42 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.6.41 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs
trackler-2.0.6.40 tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs