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