コード例 #1
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);
        }
コード例 #2
0
        public void Find_FindRecipeIngredientsInDatabase_RecipeIngredients()
        {
            //Arrange
            RecipeIngredients testRecipeIngredients = new RecipeIngredients(1, 1);

            testRecipeIngredients.Save();

            //Act
            RecipeIngredients resultById = RecipeIngredients.FindRecipeIngredientsById(testRecipeIngredients.GetId());

            //Assert
            Assert.AreEqual(testRecipeIngredients, resultById);
        }