示例#1
0
        private void LoadKeywords()
        {
            if (Plan.Any())
            {
                return;
            }

            if (!ServiceLocator.IsInitialised() || !ServiceLocator.Instance.Kernel.HasComponent(typeof(ITypeRegistry)))
            {
                throw new InvalidOperationException("Cannot construct RunScenario from file without Registered ITypeRegistry");
            }

            if (FileName != null)
            {
                _plan.AddRange(
                    new DataContext(new FileObjectAccess(FileFinder.Find(FileName),
                                                         ServiceLocator.Instance.Resolve <ITypeRegistry>())).GetAll <Keyword>());
            }
        }