Exemple #1
0
        public void WriteLine_WritesToScrawler()
        {
            var scrawlerMock = new Mock <Scrawler>();
            var context      = new WriteContext(scrawlerMock.Object);

            var result = string.Empty;

            scrawlerMock.Setup(s => s.Write(It.IsAny <string>()))
            .Callback <string>(s => result += s)
            .Verifiable();

            context.WriteLine(TestWord);

            scrawlerMock.Verify();

            Equal($"{TestWord}{context.LineTerminator}", result);
        }