public void ToStringTest() { ResultLog l0 = new ResultLog(); l0.LogGood("Good result."); l0.LogBad("Error result."); string s = l0.ToString(); Assert.True(s.Contains("Good result") && s.Contains("Error result")); }
public void ClearTest() { ResultLog l0 = new ResultLog(); l0.LogGood("Good result."); l0.LogBad("Error result."); l0.Clear(); Assert.Empty(l0); Assert.Equal(0, l0.GoodCount); Assert.Equal(0, l0.BadCount); Assert.True(l0.IsNull); }
internal static void ResultLogExample() { ResultLog log0 = new ResultLog("First log"); log0.LogBad("This is an error message."); log0.LogSuspect("This is a warning message"); ResultLog log1 = new ResultLog("Second Log", log0); log1.LogGood("This is a good message."); Console.Write(log1); // Result: // Error: This is an error message. // Warning: This is a warning message // This is a good message. }
public void Ctor2ArgTest() { ResultLog l0 = new ResultLog(); l0.LogGood("Good result."); l0.LogBad("Error result."); ResultLog l1 = new ResultLog(); l1.LogSuspect("Suspect result."); ResultLog l = new ResultLog("Merged", l0, l1); Assert.Equal("Merged", l.Caption); Assert.Equal(3, l.Count); Assert.Equal(1, l.GoodCount); Assert.Equal(1, l.BadCount); Assert.Equal(1, l.SuspectCount); Assert.False(l.IsGood); Assert.False(l.IsSuspect); Assert.True((l.IsBad)); Assert.False(l.IsNull); }