상속: IComparable
예제 #1
0
파일: Suite.cs 프로젝트: dolittle/Forseti
 public void AddDescription(Description description)
 {
     if (!_descriptions.Contains(description))
     {
         _descriptions.Add(description);
         description.Suite = this;
     }
 }
예제 #2
0
        public IEnumerable<Suite> HandleFiles(IEnumerable<IFile> files)
        {
			var affectedSuites = new List<Suite>();
			
            foreach (var file in files)
            {
                var isSystem = IsSystem(file);
                if (isSystem)
                {
                    var suite = new Suite(file);
                    _suites.Add(suite);
                }

                var isDescription = IsDescription(file);
                if (isDescription && _descriptionComponents.ContainsKey(SystemComponentName))
                {
                    var systemComponentIndex = _descriptionComponents[SystemComponentName];
                    foreach (var suite in _suites)
                    {
                        var match = _descriptionsSearchPathRegex.Match(file.FullPath);
                        if (match.Groups[systemComponentIndex+1].Value == suite.System)
                        {
                            var description = new Description(file);

                            // Todo: Hack for now
                            description.AddCase(new Case());
                            suite.AddDescription(description);
							
							if( !affectedSuites.Contains(suite) ) {
								affectedSuites.Add (suite);
							}
                        }
                    }
                }
            }
			
			return affectedSuites;
        }
예제 #3
0
        void PrintSuiteInformation(Description description)
        {
            var descriptionHasFailingCases = description.Cases.Any(c => !Case.IsDummyOrEmptyCase(c) && c.Result.Success == false);

            if (_options.OnlyOutputFailed && !descriptionHasFailingCases)
                return;

            Console.WriteLine("");
            Console.WriteLine("for( {0} ) ", description.Suite.FriendlyName());
            Console.WriteLine(" describing( {0} ) ", description.FriendlyName());
        }
예제 #4
0
        private void PrintDescriptionWithoutExecutedCases(Description description)
        {
            if (_options.OnlyOutputFailed)
                return;

            Console.WriteLine(" no cases executed for description ");
        }
예제 #5
0
파일: Harness.cs 프로젝트: dolittle/Forseti
        bool IsDescriptionForSystem(Description description, Suite suite)
        {
            var systemComponents = _systemsSearchPathRegex.Match(suite.SystemFile.FullPath);
            var descriptionComponents = _descriptionsSearchPathRegex.Match(description.File.FullPath);

            for (int i = 0; i < _systemComponents.Count(); i++)
            {
                var customComponent = _systemComponents.ElementAt(i);
                var matchIndex = customComponent.Value + 1;
                if (systemComponents.Groups.Count >= matchIndex && descriptionComponents.Groups.Count >= matchIndex)
                    if (systemComponents.Groups[matchIndex].Value == descriptionComponents.Groups[matchIndex].Value)
                        continue;

                return false;
            }
            return true;
        }
예제 #6
0
파일: Harness.cs 프로젝트: dolittle/Forseti
        public IEnumerable<Suite> HandleFiles(IEnumerable<IFile> files)
        {
			var affectedSuites = new List<Suite>();
			
            foreach (var file in files)
            {
                var isSystem = IsSystem(file);
                if (isSystem)
                {
                    var suite = _suites.Where(s => s.SystemFile.FullPath == file.FullPath).SingleOrDefault();
                    if (suite == null)
                    {
                        suite = new Suite(file);
                        _suites.Add(suite);
                    }

                    if (!affectedSuites.Contains(suite))
                        affectedSuites.Add(suite);
                }

                var isDescription = IsDescription(file);
                if (isDescription)
                {
                    var description = new Description(file);
                    _suites.Where(s => IsDescriptionForSystem(description, s))
                           .ForEach(s =>
                           {
                               s.AddDescription(description);

                                if (!affectedSuites.Contains(s))
                                    affectedSuites.Add(s);
                           });
                }
            }
			
			return affectedSuites;
        }
예제 #7
0
 public void AddDescription(Description description)
 {
     _descriptions.Add(description);
     description.Suite = this;
 }