Sha256: 2d7229f7bbe86045ae8c3d3c5a16ff41315f09b04ffea603ba2ab9d5e074f188

Contents?: true

Size: 1.1 KB

Versions: 240

Compression:

Stored size: 1.1 KB

Contents

module QueenAttackTest

open System
open NUnit.Framework

open QueenAttack

[<Test>]
let ``Cannot occupy same space`` () =
    let white = (2, 4)
    let black = (2, 4)
    Assert.That((fun () -> canAttack white black |> ignore), Throws.Exception)

[<Test>]
[<Ignore("Remove to run test")>]
let ``Cannot attack`` () =
    Assert.False(canAttack (2, 3) (4, 7))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Can attack on same row`` () =
    Assert.True(canAttack (2, 4) (2, 7))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Can attack on same column`` () =
    Assert.True(canAttack (5, 4) (2, 4))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Can attack on diagonal`` () =
    Assert.True(canAttack (1, 1) (6, 6))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Can attack on other diagonal`` () =
    Assert.True(canAttack (0, 6) (1, 7))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Can attack on yet another diagonal`` () =
    Assert.True(canAttack (4, 1) (6, 3))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Can attack on a diagonal slanted the other way`` () =
    Assert.True(canAttack (6, 1) (1, 6))

Version data entries

240 entries across 240 versions & 1 rubygems

Version Path
trackler-2.2.1.22 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs
trackler-2.2.1.21 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs
trackler-2.2.1.20 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs
trackler-2.2.1.19 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs
trackler-2.2.1.18 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs
trackler-2.2.1.17 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs
trackler-2.2.1.16 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs
trackler-2.2.1.15 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs
trackler-2.2.1.14 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs
trackler-2.2.1.13 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs
trackler-2.2.1.12 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs
trackler-2.2.1.11 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs
trackler-2.2.1.10 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs
trackler-2.2.1.9 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs
trackler-2.2.1.8 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs
trackler-2.2.1.7 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs
trackler-2.2.1.6 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs
trackler-2.2.1.5 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs
trackler-2.2.1.4 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs
trackler-2.2.1.3 tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs