Esempio n. 1
0
        public void Find_FindRecipeCategoryInDatabase_RecipeCategory()
        {
            //Arrange
            RecipeCategory testRecipeCategory = new RecipeCategory(1, 1);

            testRecipeCategory.Save();

            //Act
            RecipeCategory resultById = RecipeCategory.FindRecipeCategoryById(testRecipeCategory.GetId());

            //Assert
            Assert.AreEqual(testRecipeCategory, resultById);
        }
Esempio n. 2
0
        public void Save_AssignsIdToObject_Id()
        {
            //Arrange
            RecipeCategory testRecipeCategory = new RecipeCategory(1, 1);

            //Act
            testRecipeCategory.Save();
            RecipeCategory savedRecipeCategory = RecipeCategory.GetAll()[0];

            int result = savedRecipeCategory.GetId();
            int testId = testRecipeCategory.GetId();

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