Пример #1
0
        public async Task ProcessingRecipeShouldYieldUniqueIdsForSteps()
        {
            var recipeParser = new JsonRecipeParser();

            List<RecipeStepDescriptor> recipeSteps = new List<RecipeStepDescriptor>();
            await recipeParser.ProcessRecipeAsync(_fileInfo.CreateReadStream(), (descripor, stepDescriptor) => {
                recipeSteps.Add(stepDescriptor);
                return Task.CompletedTask;
            });

            // Assert that each step has a unique ID.
            Assert.True(recipeSteps.GroupBy(x => x.Id).All(y => y.Count() == 1));
        }
Пример #2
0
 public void ShouldParseRecipeDescriptor()
 {
     var parser = new JsonRecipeParser();
     var descriptor = parser.ParseRecipe(_fileInfo.CreateReadStream());
     Assert.Equal("core", descriptor.Name);
     Assert.Equal("core descriptor.", descriptor.Description);
     Assert.Equal("The Orchard Team", descriptor.Author);
     Assert.Equal("http://orchardproject.net", descriptor.WebSite);
     Assert.Equal("2.0", descriptor.Version);
     Assert.Equal(true, descriptor.IsSetupRecipe);
     Assert.Equal("default", descriptor.Categories[0]);
     Assert.Equal("developer", descriptor.Tags[0]);
 }