clean code and try to add some tests
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
50f2cb43a4
commit
522f169128
@ -0,0 +1,34 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
namespace MCTGLib_UnitTests
|
||||
{
|
||||
public class UnitTest1
|
||||
{
|
||||
[Fact]
|
||||
public void Test1()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue