   test "Player rolls but fails to announce" do
     {startmsg, sockets, ports} = setup_game()
     {1, [player | _], [socket | _], [port | _]} = extract_player_seq(startmsg, sockets, ports)
-    socket
-      |> receive_message()
-      |> check_and_gettoken(:yourturn)
-      |> make_roll_msg()
-      |> send_to_server(socket, port)
-    check_broadcast_message(sockets, "PLAYER ROLLS;#{player}\n")
+    do_roll(socket, port, player, sockets)
     receive_message(socket)
     Process.sleep(@timeout)
     check_player_lost_aftermath(player, sockets, "DID NOT ANNOUNCE")

  defp make_nonsense_msg(token), do: "BLABLA;#{token}"
  defp make_announcement_msg(token, d1, d2), do: "ANNOUNCE;#{d1},#{d2};#{token}"

  test "First player receives Your Turn" do
    {startmsg, sockets, ports} = setup_game()
    {turn, _players, [socket | _], _ports} = extract_player_seq(startmsg, sockets, ports)
    assert turn == 1
    socket
      |> receive_message()
      |> check_and_gettoken(:yourturn)
  end

  test "First player rolls and receives dice" do
    {startmsg, sockets, ports} = setup_game()
    {1, [player | _], [socket | _], [port | _]} = extract_player_seq(startmsg, sockets, ports)
    socket
      |> receive_message()
      |> check_and_gettoken(:yourturn)
      |> make_roll_msg()
      |> send_to_server(socket, port)
    check_broadcast_message(sockets, "PLAYER ROLLS;#{player}\n")
    socket
      |> receive_message()
      |> check_and_gettoken(:rolled)
  end

  test "First player does nothing" do

    {startmsg, sockets, ports} = setup_game()
    {1, [player1 | _], [socket1 | _], [port1 | _]} = extract_player_seq(startmsg, sockets, ports)
    MiaServer.Game.testing_inject_dice(6,1)
    do_roll(socket1, port1, player1, sockets)
    do_announcement(socket1, port1, player1, 2, 1, sockets)
    check_player_lost_aftermath(player1, sockets, "LIED ABOUT MIA")
  end

end
