Ejemplo n.º 1
0
        public void NotifyScenarioStart_should_print_notification_and_update_stats()
        {
            _subject.NotifyScenarioStart("name", "l");
            Assert.That(_console.GetCapturedText(), Is.EqualTo("Finished=0, Failed=0, Pending=1: starting: name\r\n"));
            _console.Reset();

            _subject.NotifyScenarioStart("name2", "l");
            Assert.That(_console.GetCapturedText(), Is.EqualTo("Finished=0, Failed=0, Pending=2: starting: name2\r\n"));
        }
Ejemplo n.º 2
0
        public async Task AttemptToUndoSubScopesThrowsInvalidOperationExceptions()
        {
            _console.Reset();

            RegisterProperty(x => x.Name)
            .EnableRecording();

            RegisterProperty(x => x.LastName)
            .EnableRecording();

            var scope1 = BeginScope(async sc =>
            {
                Name       = "Aaaa";
                var scope2 = BeginScope(subScope => Name = "Cccc", sc);
                await scope2.StartAsync();
                await scope2.UndoAsync();
            });
            await scope1.StartAsync();
        }