Sha256: ff1661fa51155133099c9b3f330b5e869ac57a59f30bd21a0e04a6581c5918b0

Contents?: true

Size: 1.49 KB

Versions: 240

Compression:

Stored size: 1.49 KB

Contents

module RobotSimulatorTest

open NUnit.Framework

open RobotSimulator

[<Test>]
let ``Turn right edge case`` () =
    let robot = createRobot Bearing.West (0, 0)
    let movedRobot = turnRight robot
    Assert.That(movedRobot, Is.EqualTo(createRobot Bearing.North (0, 0)))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Turn left edge case`` () =
    let robot = createRobot Bearing.North (0, 0)
    let movedRobot = turnLeft robot
    Assert.That(movedRobot, Is.EqualTo(createRobot Bearing.West (0, 0)))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Robbie`` () =
    let robbie = createRobot Bearing.East (-2, 1)
    Assert.That(robbie, Is.EqualTo(createRobot Bearing.East (-2, 1)))

    let movedRobbie = simulate robbie "RLAALAL"
    Assert.That(movedRobbie, Is.EqualTo(createRobot Bearing.West (0, 2)))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Clutz`` () =
    let clutz = createRobot Bearing.North (0, 0)
    let movedClutz = simulate clutz "LAAARALA"
    Assert.That(movedClutz, Is.EqualTo(createRobot Bearing.West (-4, 1)))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Sphero`` () =
    let sphero = createRobot Bearing.East (2, -7)
    let movedSphero = simulate sphero "RRAAAAALA"
    Assert.That(movedSphero, Is.EqualTo(createRobot Bearing.South (-3, -8)))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Roomba`` () =
    let roomba = createRobot Bearing.South (8, 4)
    let movedRoomba = simulate roomba "LAAARRRALLLL"
    Assert.That(movedRoomba, Is.EqualTo(createRobot Bearing.North (11, 5)))

Version data entries

240 entries across 240 versions & 1 rubygems

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