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.2 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.2.1.1 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.2.1.0 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.2.0.6 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.2.0.5 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.2.0.4 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.2.0.3 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.2.0.2 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.2.0.1 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.2.0.0 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.55 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.54 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.53 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.52 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.51 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.50 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.49 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.48 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.47 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.46 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs