Пример #1
0
        static void Report(string filename, string description, string @case, bool success = true, string message = "" )
        {
            message = ParseMessage(message);
            if (HarnessResult != null)
            {
                HarnessResult.AffectedSuites.ForEach(s =>
                {
                    s.Descriptions.ForEach(d =>
                    {
                        //var descriptionWithUnderscores = description.Replace(' ', '_');
                        if (d.File.RelativePath == filename)
                        {
                            var actualCase = d.Cases.Where(c => c.Name == @case).FirstOrDefault();
                            if (actualCase == null)
                            {
                                actualCase = new Case
                                {
                                    Name = @case
                                };
                                d.AddCase(actualCase);
                            }
                            actualCase.Result = new CaseResult
                            {
                                Success = success,
                                Message = message
                            };
                        }
                    });
                });

            }
        }
Пример #2
0
 public void AddChildCase(Case @case)
 {
     @case.Parent = this;
     @case.Description = this.Description;
     _children.Add(@case);
 }
Пример #3
0
 void PrintFailedCase(Case @case)
 {
     Console.Write("  it( {0} ) ", @case.FriendlyName());
     Console.ForegroundColor = ConsoleColor.Red;
     Console.Write("FAILED");
     Console.ResetColor();
     Console.WriteLine(" with message : {0}", @case.Result.Message);
 }
Пример #4
0
        void PrintPassedCase(Case @case)
        {
            if (_options.OnlyOutputFailed)
                return;

            Console.Write("  it( {0} ) ", @case.FriendlyName());
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("PASSED");
            Console.ResetColor();
        }
Пример #5
0
 public static bool IsDummyOrEmptyCase(Case @case)
 {
     return @case == null || String.IsNullOrEmpty(@case.Name) || @case.Name == Case.DummyCase.Name;
 }
Пример #6
0
 public void AddCase(Case @case)
 {
     @case.Description = this;
     _cases.Add(@case);
 }