Sha256: b9493d85264c5e56fa57d81c582d626c83d25c60a4b5294cac4421f79db3840e

Contents?: true

Size: 1.95 KB

Versions: 109

Compression:

Stored size: 1.95 KB

Contents

// This file was auto-generated based on version 1.0.0 of the canonical data.

using Xunit;
using System;

public class SaddlePointsTest
{
    [Fact]
    public void Can_identify_single_saddle_point()
    {
        var input = new[,]
        {
            { 9, 8, 7 },
            { 5, 3, 2 },
            { 6, 6, 7 }
        };
        var sut = new SaddlePoints(input);
        var actual = sut.Calculate();
        var expected = new[] { Tuple.Create(1, 0) };
        Assert.Equal(expected, actual);
    }

    [Fact(Skip = "Remove to run test")]
    public void Can_identify_that_empty_matrix_has_no_saddle_points()
    {
        var input = new int[,] { };
        var sut = new SaddlePoints(input);
        var actual = sut.Calculate();
        Assert.Empty(actual);
    }

    [Fact(Skip = "Remove to run test")]
    public void Can_identify_lack_of_saddle_points_when_there_are_none()
    {
        var input = new[,]
        {
            { 1, 2, 3 },
            { 3, 1, 2 },
            { 2, 3, 1 }
        };
        var sut = new SaddlePoints(input);
        var actual = sut.Calculate();
        Assert.Empty(actual);
    }

    [Fact(Skip = "Remove to run test")]
    public void Can_identify_multiple_saddle_points()
    {
        var input = new[,]
        {
            { 4, 5, 4 },
            { 3, 5, 5 },
            { 1, 5, 4 }
        };
        var sut = new SaddlePoints(input);
        var actual = sut.Calculate();
        var expected = new[] { Tuple.Create(0, 1), Tuple.Create(1, 1), Tuple.Create(2, 1) };
        Assert.Equal(expected, actual);
    }

    [Fact(Skip = "Remove to run test")]
    public void Can_identify_saddle_point_in_bottom_right_corner()
    {
        var input = new[,]
        {
            { 8, 7, 9 },
            { 6, 7, 6 },
            { 3, 2, 5 }
        };
        var sut = new SaddlePoints(input);
        var actual = sut.Calculate();
        var expected = new[] { Tuple.Create(2, 2) };
        Assert.Equal(expected, actual);
    }
}

Version data entries

109 entries across 109 versions & 1 rubygems

Version Path
trackler-2.2.1.131 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs
trackler-2.2.1.130 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs
trackler-2.2.1.129 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs
trackler-2.2.1.128 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs
trackler-2.2.1.127 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs
trackler-2.2.1.126 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs
trackler-2.2.1.125 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs
trackler-2.2.1.124 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs
trackler-2.2.1.123 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs
trackler-2.2.1.122 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs
trackler-2.2.1.121 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs
trackler-2.2.1.120 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs
trackler-2.2.1.119 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs
trackler-2.2.1.118 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs
trackler-2.2.1.117 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs
trackler-2.2.1.116 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs
trackler-2.2.1.115 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs
trackler-2.2.1.114 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs
trackler-2.2.1.113 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs
trackler-2.2.1.111 tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs