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.
sae201_qwirkle/Qwirkle/TestBase/TestTile.cs

47 lines
1.1 KiB

using QwirkleClassLibrary.Tiles;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestBase
{
public class TestTile
{
[Fact]
public void TestCreateCorrect()
{
Tile t = new Tile(Shape.Star, Color.Blue);
Assert.NotNull(t);
Assert.Equal(Shape.Star, t.GetShape);
Assert.Equal(Color.Blue, t.GetColor);
}
public static IEnumerable<object[]> Data_Tile()
{
yield return new object[]
{
new Tile(Shape.Round, Color.Green)
};
yield return new object[]
{
new Tile(Shape.Shuriken, Color.Red)
};
}
[Theory]
[MemberData(nameof(Data_Tile))]
public void Test_Name(Tile t)
{
Shape s = t.GetShape;
Color c = t.GetColor;
string str = (c.ToString() + s.ToString());
Assert.Equal(t.NameColorTile(), str);
}
}
}