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.
SAE-2.01/MCTG/Tests/MCTGLib_UnitTests/Recipe_UT.cs

34 lines
842 B

using MCTGLib;
namespace MCTGLib_UnitTests
{
public class Recipe_UT
{
[Fact]
public void TestConstructorNotNull()
{
Recipe r1 = new Recipe();
Assert.NotNull(r1);
}
[Fact]
public void TestConstructorWithValidDefaults()
{
Recipe r1 = new Recipe();
Assert.Equal("Recipe n10", r1.Title);
Assert.Equal("A recipe.", r1.Description);
}
[Fact]
public void TestComputeId()
{
List<Recipe> lr = new List<Recipe>();
for (int i = 0; i < 11; i++)
lr.Add(new Recipe());
Assert.Equal((uint)18, lr.ElementAt(8).Id);
Assert.Equal((uint)19, lr.ElementAt(9).Id);
Assert.Equal((uint)110, lr.ElementAt(10).Id);
}
}
}