Merge pull request 'Collection de recettes' (#24) from feature/17-model-collection-recipes into dev-model
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Reviewed-on: #24pull/35/head
commit
0649ddba15
@ -1,11 +0,0 @@
|
||||
namespace MCTGLib_UnitTests
|
||||
{
|
||||
public class UnitTest1
|
||||
{
|
||||
[Fact]
|
||||
public void Test1()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue