当前位置: 首页>>代码示例>>C#>>正文


C# Configuration.GetItem方法代码示例

本文整理汇总了C#中Configuration.GetItem方法的典型用法代码示例。如果您正苦于以下问题:C# Configuration.GetItem方法的具体用法?C# Configuration.GetItem怎么用?C# Configuration.GetItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Configuration的用法示例。


在下文中一共展示了Configuration.GetItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ParseArguments

 private static void ParseArguments(Configuration configuration, ICollection<string> theArguments)
 {
     if (theArguments.Count == 0) {
         return;
     }
     string lastSwitch = string.Empty;
     foreach (string argument in theArguments) {
         if (argument.StartsWith("-")) {
             lastSwitch = argument.Substring(1).ToLower();
         }
         else {
             switch (lastSwitch) {
                 case "i":
                     configuration.GetItem<Settings>().InputFolder = argument;
                     break;
                 case "o":
                     configuration.GetItem<Settings>().OutputFolder = argument;
                     break;
                 case "x":
                     foreach (string pattern in argument.Split(';')) {
                         configuration.GetItem<FileExclusions>().Add(pattern);
                     }
                     break;
             }
         }
     }
     if (configuration.GetItem<Settings>().InputFolder == null)
         throw new FormatException("Missing input folder");
     if (configuration.GetItem<Settings>().OutputFolder == null)
         throw new FormatException("Missing output folder");
 }
开发者ID:nhajratw,项目名称:fitsharp,代码行数:31,代码来源:FolderRunner.cs

示例2: SetUp

        public void SetUp()
        {
            config = new TypeDictionary();
            config.GetItem<Settings>().InputFolder = "in";
            config.GetItem<Settings>().OutputFolder = "out";

            folders = new FolderTestModel();
        }
开发者ID:skolima,项目名称:fitsharp,代码行数:8,代码来源:SuiteRunnerTest.cs

示例3: Service

 public Service(Configuration configuration)
     : base(configuration, configuration.GetItem<Operators>())
 {
     ApplicationUnderTest.AddNamespace("fit");
     ApplicationUnderTest.AddNamespace("fitSharp.Fit.Fixtures");
     ApplicationUnderTest.AddAssembly(Assembly.GetExecutingAssembly().CodeBase);
     configuration.GetItem<Operators>().AddNamespaces(ApplicationUnderTest);
 }
开发者ID:skolima,项目名称:fitsharp,代码行数:8,代码来源:Service.cs

示例4: Run

 public int Run(string[] commandLineArguments, Configuration configuration, ProgressReporter reporter)
 {
     service = configuration.GetItem<Service>();
     service.ApplicationUnderTest = configuration.GetItem<ApplicationUnderTest>();
     ParseCommandLine(commandLineArguments);
     new Interpreter(messenger, assemblyPaths, service).ProcessInstructions();
     return 0;
 }
开发者ID:vaibhavsapre,项目名称:fitsharp,代码行数:8,代码来源:Runner.cs

示例5: Execute

 public void Execute()
 {
     Configuration currentConfig = Context.Configuration;
     var newConfig = new Configuration(Context.Configuration);
     newConfig.GetItem<Service.Service>().ApplicationUnderTest = newConfig.GetItem<ApplicationUnderTest>();
     Context.Configuration = newConfig;
     ExecuteOnConfiguration();
     Context.Configuration = currentConfig;
 }
开发者ID:vaibhavsapre,项目名称:fitsharp,代码行数:9,代码来源:StoryTest.cs

示例6: CreateStoryTestFolder

        StoryTestFolder CreateStoryTestFolder(Configuration configuration)
        {
            var storyTestFolder = new StoryTestFolder(configuration, new FileSystemModel(configuration.GetItem<Settings>().CodePageNumber));

            string tagList = configuration.GetItem<Settings>().TagList;
            if (!string.IsNullOrEmpty(tagList))
                storyTestFolder.AddPageFilter(new TagFilter(tagList));

            return storyTestFolder;
        }
开发者ID:skolima,项目名称:fitsharp,代码行数:10,代码来源:FolderRunner.cs

示例7: ExecutesSuiteTearDownLast

 public void ExecutesSuiteTearDownLast()
 {
     var folders = new FolderTestModel();
     folders.MakeFile("in\\suiteteardown.html", "<table><tr><td>fixture</td></tr></table>");
     folders.MakeFile("in\\zzzz.html", "<table><tr><td>fixture</td></tr></table>");
     var config = new Configuration();
     config.GetItem<Settings>().InputFolder = "in";
     config.GetItem<Settings>().OutputFolder = "out";
     var runner = new SuiteRunner(config, new NullReporter());
     runner.Run(new StoryTestFolder(config, folders), string.Empty);
     int tearDown = folders.FileContent("out\\reportIndex.html").IndexOf("suiteteardown.html");
     int otherFile = folders.FileContent("out\\reportIndex.html").IndexOf("zzzz.html");
     Assert.IsTrue(otherFile < tearDown);
 }
开发者ID:vaibhavsapre,项目名称:fitsharp,代码行数:14,代码来源:SuiteRunnerTest.cs

示例8: RunTestFixture

 public void RunTestFixture(string theRows)
 {
     string html = string.Format("<table><tr><td>fit.Test.FitUnit.TestFixtureFixture</td></tr>{0}</table>", theRows);
     Tables = Parse.ParseFrom(html);
     var configuration = new Configuration(Processor.Configuration);
     configuration.GetItem<Settings>().Runner = "fit.Test.FitUnit.MyRunner";
     new fitSharp.Machine.Application.Runner(new string[] {}, Processor.Configuration, new NullReporter());
 }
开发者ID:abombss,项目名称:fitsharp,代码行数:8,代码来源:FixtureTest.cs

示例9: Run

 public int Run(Configuration configuration, IEnumerable<string> arguments, ProgressReporter reporter)
 {
     ParseArguments(arguments);
     myReporter = reporter;
     Run(new StoryTestFolder(configuration, new FileSystemModel(configuration.GetItem<Settings>().CodePageNumber)),
         mySelection);
     return 0; //todo: return counts exceptions + wrong or whatever
 }
开发者ID:vaibhavsapre,项目名称:fitsharp,代码行数:8,代码来源:SuiteRunner.cs

示例10: AddAssemblies

 public void AddAssemblies(Configuration configuration)
 {
     foreach (string assemblyPath in AssemblyPaths) {
         if (assemblyPath == "defaultPath") continue;
         configuration.GetItem<ApplicationUnderTest>().AddAssembly(assemblyPath.Replace("\"", string.Empty));
     }
     if (HasConfigFilePath())
         AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", ConfigFilePath);
 }
开发者ID:vaibhavsapre,项目名称:fitsharp,代码行数:9,代码来源:PathParser.cs

示例11: ChangesDontShowInCopy

 public void ChangesDontShowInCopy()
 {
     var test = new TestConfig {Data = "stuff"};
     configuration.SetItem(test.GetType(), test);
     var copy = new Configuration(configuration);
     configuration.GetItem<TestConfig>().Data = "other";
     Assert.AreEqual("stuff", copy.GetItem<TestConfig>().Data);
     Assert.AreEqual("other", configuration.GetItem<TestConfig>().Data);
 }
开发者ID:nhajratw,项目名称:fitsharp,代码行数:9,代码来源:ConfigurationTest.cs

示例12: Run

 public int Run(IList<string> commandLineArguments, Configuration configuration, ProgressReporter reporter)
 {
     var now = DateTime.Now;
     myProgressReporter = reporter;
     var result = Run(configuration, commandLineArguments);
     //todo: to suiterunner?
     if (!configuration.GetItem<Settings>().DryRun)
         reporter.Write(string.Format("\n{0}, time: {1}\n", Results, DateTime.Now - now));
     return result;
 }
开发者ID:skolima,项目名称:fitsharp,代码行数:10,代码来源:FolderRunner.cs

示例13: ExecuteOnConfiguration

 public void ExecuteOnConfiguration(Configuration configuration)
 {
     string apartmentConfiguration = configuration.GetItem<Settings>().ApartmentState;
     if (apartmentConfiguration != null) {
         var desiredState = (ApartmentState)Enum.Parse(typeof(ApartmentState), apartmentConfiguration);
         if (Thread.CurrentThread.GetApartmentState() != desiredState) {
             var thread = new Thread(o => DoTables((Configuration)o));
             thread.SetApartmentState(desiredState);
             thread.Start(configuration);
             thread.Join();
             return;
         }
     }
     DoTables(configuration);
 }
开发者ID:woodyza,项目名称:fitsharp,代码行数:15,代码来源:StoryTest.cs

示例14: ParseArguments

        void ParseArguments(Configuration configuration, IList<string> arguments)
        {
            if (arguments.Count == 0) {
                return;
            }
            var argumentParser = new ArgumentParser();
            argumentParser.AddSwitchHandler("d", () => configuration.GetItem<Settings>().DryRun = true);
            argumentParser.AddArgumentHandler("i", value => configuration.GetItem<Settings>().InputFolder = value);
            argumentParser.AddArgumentHandler("o", value => configuration.GetItem<Settings>().OutputFolder = value);
            argumentParser.AddArgumentHandler("s", value => selectedFile = value);
            argumentParser.AddArgumentHandler("x", value => configuration.GetItem<FileExclusions>().AddRange(value.Split(';')));
            argumentParser.AddArgumentHandler("t", value => configuration.GetItem<Settings>().TagList = value);

            argumentParser.Parse(arguments);
            if (configuration.GetItem<Settings>().InputFolder == null)
                throw new FormatException("Missing input folder");
            if (configuration.GetItem<Settings>().OutputFolder == null)
                throw new FormatException("Missing output folder");
        }
开发者ID:skolima,项目名称:fitsharp,代码行数:19,代码来源:FolderRunner.cs

示例15: ParseArgs

 public bool ParseArgs(Configuration configuration, string[] args)
 {
     string resultsFile = null;
     string outputType = "text";
     int index = 0;
     try {
         while (args[index].StartsWith("-")) {
             string option = args[index++];
             if ("-results".Equals(option))
                 resultsFile = args[index++];
             else if ("-v".Equals(option))
                 verbose = true;
             else if ("-debug".Equals(option))
                 debug = true;
             else if ("-nopaths".Equals(option))
                 usingDownloadedPaths = false;
             else if (option == "-suiteFilter")
                 suiteFilter = args[index++];
             else if ("-format".Equals(option))
                 outputType = args[index++];
             else
                 throw new Exception("Bad option: " + option);
         }
         CreateResultWriter(resultsFile, outputType,
                            new FileSystemModel(configuration.GetItem<Settings>().CodePageNumber));
         host = args[index++];
         port = Int32.Parse(args[index++]);
         pageName = args[index++];
         string assemblies = null;
         while (args.Length > index)
             assemblies = assemblies == null ? args[index++] : (assemblies + ";" + args[index++]);
         if (assemblies != null) {
             new PathParser(assemblies).AddAssemblies(configuration);
         }
         return true;
     }
     catch (Exception) {
         return false;
     }
 }
开发者ID:russelyang,项目名称:fitsharp,代码行数:40,代码来源:TestRunner.cs


注:本文中的Configuration.GetItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。