public Form1()
        {
            InitializeComponent();

            RecipeCreatorTest test = new RecipeCreatorTest();

            test.CheckFilesInfo();
            test.IngredientsFileContentsCheck();
            test.RecipesFileContentsCheck();

            FileOp fileOp = new FileOp();

            string[] filesInfoIngredients = fileOp.getIngredientsInfo();
            string[] filesInfoRecipes     = fileOp.getRecipesInfo();

            fileNameAndContentIngredientCollector = fileOp.getIngredientsFileContents(filesInfoIngredients);
            fileNameAndContentRecipeCollector     = fileOp.getRecipesFileContents(filesInfoRecipes);
            List <string> keyList = new List <string>(fileNameAndContentIngredientCollector.Keys);


            foreach (string key in keyList)
            {
                lstSoup.Items.Add(key);
            }
        }
Пример #2
0
        public void RecipesFileContentsCheck()
        {
            FileOp fileOp1 = new FileOp();

            string[] result1 = fileOp1.getRecipesInfo();
            Dictionary <string, List <string> > contents1 = fileOp1.getRecipesFileContents(result1);


            FileOp fileOp2 = new FileOp();

            string[] result2 = fileOp2.getRecipesInfo();
            Dictionary <string, List <string> > contents2 = fileOp2.getRecipesFileContents(result2);


            Assert.AreEqual(contents1, contents2);
        }