public void Init() { // Instantiate the class to test this.toTest = new RecipeStepDTO() { Instruction = "Peler la tomate", Foods = new FoodDTO[] { new FoodDTO() { Name = "Tomato", Mass = 500, }, }, }; }
public void TestNotEqualsOnInstructionAndFoods() { var recipeStep = new RecipeStepDTO() { Instruction = "Peler la tomateee", Foods = new FoodDTO[] { new FoodDTO() { Name = "Tomatooo", Mass = 500, }, }, }; Assert.AreNotEqual(recipeStep, this.toTest); }
public void TestEqualReverse() { var recipeStep = new RecipeStepDTO() { Instruction = "Peler la tomate", Foods = new FoodDTO[] { new FoodDTO() { Name = "Tomato", Mass = 500, }, }, }; Assert.AreEqual(recipeStep, this.toTest); }
public void TestGetHashCode() { var recipeStep = new RecipeStepDTO() { Instruction = "Peler la tomate", Foods = new FoodDTO[] { new FoodDTO() { Name = "Tomato", Mass = 500, }, }, }; int expected = recipeStep.GetHashCode(); int actual = this.toTest.GetHashCode(); Assert.AreEqual(expected, actual); }
public void TestStepsCollectionNotEqualOnInstructionAndFoods() { RecipeStepDTO[] unexpected = new RecipeStepDTO[] { new RecipeStepDTO() { Instruction = "Peler la tomateee", Foods = new FoodDTO[] { new FoodDTO() { Name = "Tomatooo", Mass = 500, }, }, }, }; RecipeStepDTO[] actual = this.toTest.Steps; CollectionAssert.AreNotEqual(unexpected, actual); }
public void TestStepsCollectionEqual() { RecipeStepDTO[] expected = new RecipeStepDTO[] { new RecipeStepDTO() { Instruction = "Peler la tomate", Foods = new FoodDTO[] { new FoodDTO() { Name = "Tomato", Mass = 500, }, }, }, }; RecipeStepDTO[] actual = this.toTest.Steps; CollectionAssert.AreEqual(expected, actual); }