Sha256: 7c325acdbc4f275679143b42b3f6c9c8ba4ab7e935081c468c9c480398f4a008

Contents?: true

Size: 1.74 KB

Versions: 115

Compression:

Stored size: 1.74 KB

Contents

using System;
using NUnit.Framework;

public class QueenAttackTest
{
    [Test]
    public void Cannot_occupy_same_space()
    {
        var white = new Queen(2, 4);
        var black = new Queen(2, 4);
        Assert.Throws<ArgumentException>(() => new Queens(white, black));
    }

    [Ignore("Remove to run test")]
    [Test]
    public void Cannot_attack()
    {
        var queens = new Queens(new Queen(2, 3), new Queen(4, 7));
        Assert.False(queens.CanAttack());
    }

    [Ignore("Remove to run test")]
    [Test]
    public void Can_attack_on_same_row()
    {
        var queens = new Queens(new Queen(2, 4), new Queen(2, 7));
        Assert.True(queens.CanAttack());
    }

    [Ignore("Remove to run test")]
    [Test]
    public void Can_attack_on_same_column()
    {
        var queens = new Queens(new Queen(5, 4), new Queen(2, 4));
        Assert.True(queens.CanAttack());
    }

    [Ignore("Remove to run test")]
    [Test]
    public void Can_attack_on_diagonal()
    {
        var queens = new Queens(new Queen(1, 1), new Queen(6, 6));
        Assert.True(queens.CanAttack());
    }

    [Ignore("Remove to run test")]
    [Test]
    public void Can_attack_on_other_diagonal()
    {
        var queens = new Queens(new Queen(0, 6), new Queen(1, 7));
        Assert.True(queens.CanAttack());
    }

    [Ignore("Remove to run test")]
    [Test]
    public void Can_attack_on_yet_another_diagonal()
    {
        var queens = new Queens(new Queen(4, 1), new Queen(6, 3));
        Assert.True(queens.CanAttack());
    }

    [Ignore("Remove to run test")]
    [Test]
    public void Can_attack_on_a_diagonal_slanted_the_other_way()
    {
        var queens = new Queens(new Queen(6, 1), new Queen(1, 6));
        Assert.True(queens.CanAttack());
    }
}

Version data entries

115 entries across 115 versions & 1 rubygems

Version Path
trackler-2.0.6.39 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs
trackler-2.0.6.38 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs
trackler-2.0.6.37 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs
trackler-2.0.6.36 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs
trackler-2.0.6.35 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs
trackler-2.0.6.34 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs
trackler-2.0.6.33 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs
trackler-2.0.6.32 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs
trackler-2.0.6.31 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs
trackler-2.0.6.30 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs
trackler-2.0.6.29 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs
trackler-2.0.6.28 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs
trackler-2.0.6.27 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs
trackler-2.0.6.26 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs
trackler-2.0.6.25 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs
trackler-2.0.6.24 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs
trackler-2.0.6.23 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs
trackler-2.0.6.22 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs
trackler-2.0.6.21 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs
trackler-2.0.6.20 tracks/csharp/exercises/queen-attack/QueenAttackTest.cs