correction on UT, simplified projects name

pull/24/head
Alexandre Agostinho 2 years ago
parent a38e35d1ed
commit f90a322f45

@ -1,6 +1,6 @@
// See https://aka.ms/new-console-template for more information // See https://aka.ms/new-console-template for more information
using MCTGLib; using Model;
Console.WriteLine("Hello, World!\n"); Console.WriteLine("Hello, World!\n");

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace MCTGLib namespace Model
{ {
public class PreparationStep public class PreparationStep
{ {

@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
namespace MCTGLib namespace Model
{ {
public class Recipe : IEquatable<Recipe> public class Recipe : IEquatable<Recipe>

@ -3,7 +3,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
namespace MCTGLib namespace Model
{ {
public class RecipeCollection : IList<Recipe>, IEquatable<RecipeCollection> public class RecipeCollection : IList<Recipe>, IEquatable<RecipeCollection>

@ -1,34 +1,32 @@
using MCTGLib; using Model;
namespace MCTGLib_UnitTests namespace Model_UnitTests
{ {
public class Recipe_UT public class Recipe_UT
{ {
[Fact] [Fact]
public void TestConstructorNotNull() public void TestConstructorNotNull()
{ {
Recipe r1 = new Recipe(); Recipe r1 = new Recipe("R1");
Assert.NotNull(r1); Assert.NotNull(r1);
} }
[Fact] [Fact]
public void TestConstructorWithValidDefaults() public void TestConstructorWithValidDefaults()
{ {
Recipe r1 = new Recipe(); Recipe r2 = new Recipe("Recipe n2");
Assert.Equal("Recipe n10", r1.Title); Assert.Equal("Recipe n2", r2.Title);
Assert.Equal("A recipe.", r1.Description); Assert.Equal("No Description.", r2.Description);
} }
[Fact] [Fact]
public void TestComputeId() public void TestRecipeId()
{ {
List<Recipe> lr = new List<Recipe>(); Recipe r3 = new Recipe("R3");
for (int i = 0; i < 11; i++) Recipe r4 = new Recipe("R4");
lr.Add(new Recipe());
Assert.Equal((uint)18, lr.ElementAt(8).Id); Assert.Equal(2, r3.Id);
Assert.Equal((uint)19, lr.ElementAt(9).Id); Assert.Equal(3, r4.Id);
Assert.Equal((uint)110, lr.ElementAt(10).Id);
} }
} }
} }
Loading…
Cancel
Save