Beispiel #1
0
        public void SaveAndGetAll_SavesToDatabaseAndReturnAll_RecipeIngredients()
        {
            //Arrange
            RecipeIngredients testRecipeIngredients = new RecipeIngredients(1, 1);

            //Act
            testRecipeIngredients.Save();
            List <RecipeIngredients> result   = RecipeIngredients.GetAll();
            List <RecipeIngredients> testList = new List <RecipeIngredients> {
                testRecipeIngredients
            };

            //Assert
            CollectionAssert.AreEqual(testList, result);
        }
Beispiel #2
0
        public void Save_AssignsIdToObject_Id()
        {
            //Arrange
            RecipeIngredients testRecipeIngredients = new RecipeIngredients(1, 1);

            //Act
            testRecipeIngredients.Save();
            RecipeIngredients savedRecipeIngredients = RecipeIngredients.GetAll()[0];

            int result = savedRecipeIngredients.GetId();
            int testId = testRecipeIngredients.GetId();

            //Assert
            Assert.AreEqual(testId, result);
        }