Beispiel #1
0
        public void AppendFormatsAsExpected()
        {
            IConsoleService console = Substitute.For <IConsoleService>();

            using (console.AppendConsoleTitle("Rocks {0}", "on"))
            {
                console.Received(1).Title = ": Rocks on";
            }
        }
Beispiel #2
0
        public void TitleIsAppendedAsExpected()
        {
            IConsoleService console = Substitute.For <IConsoleService>();

            console.Title.Returns("MyTitle");

            using (console.AppendConsoleTitle("Rocks"))
            {
                console.Received(1).Title = "MyTitle: Rocks";
                console.ClearReceivedCalls();
            }

            console.Received(1).Title = "MyTitle";
        }