コード例 #1
0
        public void GetSection_WithNoValidSection_ShouldNotBeNull()
        {
            var sut = new SectionExtractor();

            var section = sut.GetSection<string>("connectionStrings");

            section.ShouldBeNull();
        }
コード例 #2
0
        public void GetSection_WithNonExistingSection_ShouldNotBeNull()
        {
            var sut = new SectionExtractor();

            var section = sut.GetSection<ConnectionStringsSection>("connectionStrings2");

            section.ShouldBeNull();
        }
コード例 #3
0
        private static async Task <ISection> AskForSection()
        {
            await SectionExtractor.ExtractSectionsForCourse(SharedVars.SelectedCourseLink);

            var result = MenuChooseItem.AskInputForSingleItemFromList(SharedVars.Sections, "section");

            SharedVars.SelectedSection = result;
            return(result);
        }
コード例 #4
0
 private void CheckStructure(string expectedResult, string src)
 {
     Parse(src, parser =>
     {
         var file      = parser.file();
         var extractor = new SectionExtractor();
         extractor.Visit(file);
         extractor.Outpout.Should().Be(expectedResult);
     });
 }