You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
494 B
26 lines
494 B
defmodule TetrisTest do |
|
use ExUnit.Case |
|
import Tetris |
|
alias Tetris.{Brick} |
|
|
|
test "try to move right, success" do |
|
brick = Brick.new(%{location: {5,1}}) |
|
bottom = %{} |
|
|
|
expected = brick |> Brick.right |
|
actual = try_right(brick, bottom) |
|
|
|
assert actual == expected |
|
end |
|
|
|
test "try to move right, failure returns original brick " do |
|
brick = Brick.new(%{location: {8,1}}) |
|
bottom = %{} |
|
|
|
actual = try_right(brick, bottom) |
|
|
|
assert actual == brick |
|
end |
|
|
|
|
|
end
|
|
|