function [] = testHexClass()
close all
clear all

hex1 = Hex(5,6,0);
hex2 = Hex(6,5,1);
if (~isa(hex1,'Hex') || ~isa(hex2,'Hex') || ...
    hex1.player ~= 0 || hex1.xcoord ~= 5 || hex1.ycoord ~= 6 || ...
    hex2.player ~= 1 || hex2.xcoord ~= 6 || hex2.ycoord ~= 5)
    disp('error, Hex constructor not working');
elseif (~hex1.isEmpty() || hex2.isEmpty())
    disp('error, Hex.isEmpty() not working');
else
% test drawing
hex3 = Hex(6,6,0);
hex1.draw(5,'white');
hex2.draw(5,'blue');
hex3.draw(5,'white');
player1.index = 1;
player1.color = 'blue';
hex3.setPlayer(player1);
disp('You should see 3 connected hexes, 2 blue on the right and 1 white on the left');
if (any(get(hex3.patchHandle, 'FaceColor') ~= [0 0 1]) ||...
        hex3.player ~= 1)
    disp('error, Hex.setPlayer not working');
end
end