protected override void WriteDetails() { if (Result.EntryType == EntryTypes.ResultFail) { ConsoleAdapter.Write(": "); ConsoleAdapter.Write(Writer.Colors.ResultFailMessage, Result.Message); } }
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); } }
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("]"); }
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"); } }
protected override void WriteResult() => ConsoleAdapter.Write(Result.EntryType == EntryTypes.ResultOk ? Writer.Colors.StateOk : Writer.Colors.StateFailed, Result.EntryType == EntryTypes.ResultOk ? "Ok" : "Failed");
protected override void WriteDetails() => ConsoleAdapter.Write(Writer.Colors.InjectionMessage, $"'{Result.Message}'");
protected override void WriteResult() => ConsoleAdapter.Write(HasFails ? Writer.Colors.StateFailed : Writer.Colors.StateOk, HasFails ? "Failed" : "Ok");