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.1.0.45 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.44 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.43 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.42 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.41 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.40 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.39 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.38 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.37 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.36 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.34 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.33 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.32 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.31 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.30 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.29 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.28 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.27 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.26 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs
trackler-2.1.0.25 tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs