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.
27 lines
773 B
27 lines
773 B
using Model;
|
|
|
|
namespace Model_UnitTests
|
|
{
|
|
public class Recipe_UT
|
|
{
|
|
[Fact]
|
|
public void TestVoidConstructor()
|
|
{
|
|
Recipe r = new Recipe(id: 999); // id is given to avoid tests errors with the static atrribute 'idCreator'.
|
|
Assert.NotNull(r.Title);
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("Cookies", 23, "Cookies", 23)]
|
|
[InlineData("Cookies", 1, "Cookies", 1)]
|
|
[InlineData("No title.", 1, "", 1)]
|
|
public void TestConstructor(string expectedTitle, int expectedId, string title, int? id)
|
|
{
|
|
Recipe r = new Recipe(title, id);
|
|
Assert.NotNull(r.Title);
|
|
Assert.Equal(expectedId, r.Id);
|
|
Assert.Equal(expectedTitle, r.Title);
|
|
}
|
|
}
|
|
}
|