public void Spec03() { using (var testable = new WriteTestable()) { testable.Instance.Write("{0} {1}", "format", "error with {braces}"); I.Expect(testable.LastWrite).ToBe("format error with {{braces}}"); } }
public void Spec04() { using (var testable = new WriteTestable()) { I.Expect(() => { testable.Instance.Write(41, string.Empty); }).ToThrow <ArgumentException>(); } }
public void Spec01() { using (var testable = new WriteTestable()) { testable.Instance.Write("This is quite a long sentence with some words and spaces, just one comma and a full stop at the end. This is quite a long sentence with some words and spaces, just one comma and a full stop at the end. This is quite a long sentence with some words and spaces, just one comma and a full stop at the end. This is quite a long sentence with some words and spaces, just one comma and a full stop at the end. This is quite a long sentence with some words and spaces, just one comma and a full stop at the end."); var lines = testable.LastWrite.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); I.Expect(lines.All(x => x.Length <= 80)).ToBeTrue(); } }