Exemplo n.º 1
0
        public void Alert_ChannelIsDebugWrite_InvokesRaiseEventAlerter(IInjectionMessage info)
        {
            //arrange
            const InjectionAlertChannel channel = InjectionAlertChannel.DebugWrite;
            var alerterMock = new Mock <IAlerter>();
            var sut         = GetSut(debugWriteAlerter: alerterMock.Object);

            //act
            sut.Alert(info, channel);
            //assert
            alerterMock.Verify(a => a.Alert(It.Is <IInjectionMessage>((value) => info.Equals(value))));
        }
Exemplo n.º 2
0
        public void Alert_ChannelIsThrowException_InvokesRaiseEventAlerter(IInjectionMessage info)
        {
            // Arrange
            const InjectionAlertChannel channel = InjectionAlertChannel.ThrowException;
            var alerterMock = new Mock <IAlerter>();
            var sut         = GetSut(throwExceptionAlerter: alerterMock.Object);

            // Act
            sut.Alert(info, channel);

            // Assert
            alerterMock.Verify(a => a.Alert(It.Is <IInjectionMessage>(value => info.Equals(value))));
        }