Sha256: 1ea4c67c4784c82418183cf55d15e04ec0a63aeab630dbc4b90037ffa2dcbd86

Contents?: true

Size: 1.73 KB

Versions: 115

Compression:

Stored size: 1.73 KB

Contents

using System;
using NUnit.Framework;

public class SaddlePointTests
{
    [Test]
    public void Readme_example()
    {
        var values = new[,]
        {
            { 9, 8, 7 }, 
            { 5, 3, 2 }, 
            { 6, 6, 7 }
        };
        var actual = new SaddlePoints(values).Calculate();
        Assert.That(actual, Is.EqualTo(new [] { Tuple.Create(1, 0)}));
    }

    [Ignore("Remove to run test")]
    [Test]
    public void No_saddle_point()
    {
        var values = new[,] 
        { 
            { 2, 1 }, 
            { 1, 2 }
        };
        var actual = new SaddlePoints(values).Calculate();
        Assert.That(actual, Is.Empty);
    }

    [Ignore("Remove to run test")]
    [Test]
    public void Saddle_point()
    {
        var values = new[,] 
        { 
            { 1, 2 }, 
            { 3, 4 }
        };
        var actual = new SaddlePoints(values).Calculate();
        Assert.That(actual, Is.EqualTo(new[] { Tuple.Create(0, 1) }));
    }

    [Ignore("Remove to run test")]
    [Test]
    public void Another_saddle_point()
    {
        var values = new[,] 
        { 
            { 18,  3, 39, 19,  91 }, 
            { 38, 10,  8, 77, 320 }, 
            {  3,  4,  8,  6,   7 }
        };
        var actual = new SaddlePoints(values).Calculate();
        Assert.That(actual, Is.EqualTo(new[] { Tuple.Create(2, 2) }));
    }

    [Ignore("Remove to run test")]
    [Test]
    public void Multiple_saddle_points()
    {
        var values = new[,]
        {
            { 4, 5, 4 },
            { 3, 5, 5 },
            { 1, 5, 4 }
        };
        var actual = new SaddlePoints(values).Calculate();
        Assert.That(actual, Is.EqualTo(new[] { Tuple.Create(0, 1), Tuple.Create(1, 1), Tuple.Create(2, 1) }));
    }
}

Version data entries

115 entries across 115 versions & 1 rubygems

Version Path
trackler-2.0.6.19 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs
trackler-2.0.6.18 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs
trackler-2.0.6.17 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs
trackler-2.0.6.16 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs
trackler-2.0.6.15 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs
trackler-2.0.6.14 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs
trackler-2.0.6.13 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs
trackler-2.0.6.12 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs
trackler-2.0.6.11 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs
trackler-2.0.6.10 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs
trackler-2.0.6.9 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs
trackler-2.0.6.8 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs
trackler-2.0.6.7 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs
trackler-2.0.6.6 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs
trackler-2.0.6.5 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs
trackler-2.0.6.4 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs
trackler-2.0.6.3 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs
trackler-2.0.6.2 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs
trackler-2.0.6.1 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs
trackler-2.0.6.0 tracks/csharp/exercises/saddle-points/SaddlePointTest.cs