Пример #1
0
        public void ThenAnErrorEventHandlerShouldBeAttached()
        {
            var ex = new Exception("dummy");
            NotifyErrorsMock.Raise(e => e.Error += null, this, ex);

            InputService.Verify(s => s.RequestSuspend(), Times.Once());
            AudioService.Verify(s => s.PlaySound(Settings.Default.ErrorSoundFile, Settings.Default.ErrorSoundVolume), Times.Once());

            Assert.IsNotNull(NotificationEvent);
            Assert.AreEqual(Resources.CRASH_TITLE, NotificationEvent.Title);
            Assert.AreEqual(ex.Message, NotificationEvent.Content);
            Assert.AreEqual(NotificationTypes.Error, NotificationEvent.NotificationType);
        }
        public void ThenAnErrorEventHandlerShouldBeAttached()
        {
            var ex = new Exception("dummy");

            NotifyErrorsMock.Raise(e => e.Error += null, this, ex);

            InputService.Verify(s => s.RequestSuspend(), Times.Once());
            AudioService.Verify(s => s.PlaySound(Settings.Default.ErrorSoundFile, Settings.Default.ErrorSoundVolume), Times.Once());

            Assert.That(NotificationEvent, Is.Not.Null);

            Assert.Multiple(() =>
            {
                Assert.That(NotificationEvent.Title, Is.EqualTo(Resources.CRASH_TITLE));
                Assert.That(NotificationEvent.Content, Is.EqualTo(ex.Message));
                Assert.That(NotificationEvent.NotificationType, Is.EqualTo(NotificationTypes.Error));
            });
        }