|
|
|
@ -9,25 +9,20 @@ namespace Model_UnitTests
|
|
|
|
|
{
|
|
|
|
|
Recipe r = new Recipe(id: 999); // id is given to avoid tests errors with the static atrribute 'idCreator'.
|
|
|
|
|
Assert.NotNull(r.Title);
|
|
|
|
|
Assert.NotNull(r.Description);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Theory]
|
|
|
|
|
[InlineData("Cookies", "Choco Cookies", 23, "Cookies", "Choco Cookies", 23)]
|
|
|
|
|
[InlineData("Cookies", "No description.", 1, "Cookies", "", 1)]
|
|
|
|
|
[InlineData("No title.", "Choco Cookies", 1, "", "Choco Cookies", 1)]
|
|
|
|
|
[InlineData("Cookies", "Choco Cookies", 0, "Cookies", "Choco Cookies", null)]
|
|
|
|
|
[InlineData("Cookies", "No description.", 1, "Cookies", null, 1)]
|
|
|
|
|
[InlineData("No title.", "Choco Cookies", 1, null, "Choco Cookies", 1)]
|
|
|
|
|
public void TestConstructor(string expectedTitle, string expectedDescription, int expectedId,
|
|
|
|
|
string title, string description, int? id)
|
|
|
|
|
[InlineData("Cookies", 23, "Cookies", 23)]
|
|
|
|
|
[InlineData("Cookies", 1, "Cookies", 1)]
|
|
|
|
|
[InlineData("No title.", 1, "", 1)]
|
|
|
|
|
[InlineData("Cookies", 0, "Cookies", null)]
|
|
|
|
|
[InlineData("No title.", 1, null, 1)]
|
|
|
|
|
public void TestConstructor(string expectedTitle, int expectedId, string title, int? id)
|
|
|
|
|
{
|
|
|
|
|
Recipe r = new Recipe(title, description, id);
|
|
|
|
|
Recipe r = new Recipe(title, id);
|
|
|
|
|
Assert.NotNull(r.Title);
|
|
|
|
|
Assert.NotNull(r.Description);
|
|
|
|
|
Assert.Equal(expectedId, r.Id);
|
|
|
|
|
Assert.Equal(expectedTitle, r.Title);
|
|
|
|
|
Assert.Equal(expectedDescription, r.Description);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|