|
|
|
@ -1,56 +1,46 @@
|
|
|
|
|
// using QwirkleClassLibrary;
|
|
|
|
|
// using System;
|
|
|
|
|
// using System.Collections.Generic;
|
|
|
|
|
// using System.Linq;
|
|
|
|
|
// using System.Text;
|
|
|
|
|
// using System.Threading.Tasks;
|
|
|
|
|
//
|
|
|
|
|
// namespace TestBase
|
|
|
|
|
// {
|
|
|
|
|
// internal class TestTile
|
|
|
|
|
// {
|
|
|
|
|
// public class TestCorrect // test with correct Shape and Color
|
|
|
|
|
// {
|
|
|
|
|
// [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);
|
|
|
|
|
// }
|
|
|
|
|
// // Modifier plus tard avec [Theory] à la place de [Fact] pour tester avec toutes les Shape et Color possibles (voir vidéo)
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// public class TestWrongColor // test with correct Shape but wrong Color
|
|
|
|
|
// {
|
|
|
|
|
// [Fact]
|
|
|
|
|
// public void TestCreateWrongColor()
|
|
|
|
|
// {
|
|
|
|
|
// Tile t = new Tile(Shape.Rhombus, Color.Red);
|
|
|
|
|
// Assert.Fail(t);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// public class TestWrongShape // test with wrong Shape but correct Color
|
|
|
|
|
// {
|
|
|
|
|
// [Fact]
|
|
|
|
|
// public void TestCreateWrongShape()
|
|
|
|
|
// {
|
|
|
|
|
// bool result = new Tile(Shape.Star, Color.Green);
|
|
|
|
|
// Assert.False(result);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// public class TestWrongShapeWrongColor // test with wrong Sape and wrong Color
|
|
|
|
|
// {
|
|
|
|
|
// [Fact]
|
|
|
|
|
// public void TestCreateWrongShapeWrongColor()
|
|
|
|
|
// {
|
|
|
|
|
// bool result = new Tile(Shape.Rhombus, Color.Blue);
|
|
|
|
|
// Assert.False(result);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
using QwirkleClassLibrary;
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|