예제 #1
0
 protected override void WriteDetails()
 {
     if (Result.EntryType == EntryTypes.ResultFail)
     {
         ConsoleAdapter.Write(": ");
         ConsoleAdapter.Write(Writer.Colors.ResultFailMessage, Result.Message);
     }
 }
예제 #2
0
        internal virtual void Write(Int32 padding)
        {
            ConsoleAdapter.Write($"{String.Empty.PadLeft(padding)}{Name} => ");

            WriteResult();
            WriteDetails();

            ConsoleAdapter.WriteLine();
        }
        public void Write_WritesStringToOutputStream_ExpectedOutput()
        {
            using (StringWriter sw = new StringWriter())
            {
                //Arrange
                IConsoleAdapter aConsoleAdapter = new ConsoleAdapter();
                Console.SetOut(sw);

                //Act
                aConsoleAdapter.Write("test message \n over two lines!");
                var expected = "test message \n over two lines!";
                var result   = sw.ToString();

                //Assert
                Assert.AreEqual <string>(expected, result);
            }
        }
예제 #4
0
        protected override void WriteDetails()
        {
            ConsoleAdapter.Write($" [Total: {ResultsTotal}; Ok: ");
            ConsoleAdapter.Write(Writer.Colors.ResultsOk, $"{ResultsSuccessful}");
            ConsoleAdapter.Write("; Failed: ");

            if (HasFails)
            {
                ConsoleAdapter.Write(Writer.Colors.ResultsFailed, $"{ResultsFailed + Errors}");
            }
            else
            {
                ConsoleAdapter.Write("0");
            }

            ConsoleAdapter.Write("]");
        }
예제 #5
0
 protected override void WriteResult()
 {
     if (IsIgnored)
     {
         ConsoleAdapter.Write(Writer.Colors.IgnoreMessage, IgnoreReason);
     }
     else if (IsEmpty && !IsFailed)
     {
         ConsoleAdapter.Write(Writer.Colors.StateEmpty, "Method has no test instructions!");
     }
     else if (IsFailed)
     {
         ConsoleAdapter.Write(Writer.Colors.StateFailed, "Failed");
     }
     else
     {
         ConsoleAdapter.Write(Writer.Colors.StateOk, "Ok");
     }
 }
예제 #6
0
 protected override void WriteResult()
 => ConsoleAdapter.Write(Result.EntryType == EntryTypes.ResultOk ? Writer.Colors.StateOk : Writer.Colors.StateFailed,
                         Result.EntryType == EntryTypes.ResultOk ? "Ok" : "Failed");
예제 #7
0
 protected override void WriteDetails() => ConsoleAdapter.Write(Writer.Colors.InjectionMessage, $"'{Result.Message}'");
예제 #8
0
 protected override void WriteResult() => ConsoleAdapter.Write(HasFails ? Writer.Colors.StateFailed : Writer.Colors.StateOk, HasFails ? "Failed" : "Ok");