Пример #1
0
        public void Client_receives_no_notification_after_n_minus_one_events()
        {
            // Where
            int notificationLimit = 10;

            Recorder.Recorder recorder = createStubRecorder(notificationLimit);
            bool receievedNotification = false;

            recorder.RecorderEvents += (s, e) => { receievedNotification = true; };
            Recorder.Command command = new Recorder.Command(recorder);
            for (int i = 0; i < notificationLimit; i++)
            {
                command.Execute("value something" + i + " " + i);
            }
            // When
            // Then
            Assert.IsFalse(receievedNotification);
        }
Пример #2
0
        public void Client_receives_notification_after_invalid_event()
        {
            // Where
            Recorder.Recorder recorder   = createStubRecorder(2);
            bool   receievedNotification = false;
            string commandString         = "wrong command";

            recorder.RecorderEvents += (s, e) =>
            {
                receievedNotification = true;
                Assert.IsTrue(((Recorder.RecorderEventArgs)e).Message.EndsWith(commandString));
            };
            Recorder.Command command = new Recorder.Command(recorder);

            command.Execute(commandString);

            // When
            // Then
            Assert.IsTrue(receievedNotification);
        }