コード例 #1
0
            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}}");
                }
            }
コード例 #2
0
 public void Spec04()
 {
     using (var testable = new WriteTestable())
     {
         I.Expect(() =>
         {
             testable.Instance.Write(41, string.Empty);
         }).ToThrow <ArgumentException>();
     }
 }
コード例 #3
0
            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();
                }
            }