Beispiel #1
0
        public void TestExecuteShouldPrintInvoice()
        {
            _command.Execute(InvoiceId);

            _mocker.GetMock <IInvoiceWriter>()
            .Verify(p => p.Print(_invoice),
                    Times.Once);
        }
Beispiel #2
0
        public void TestExecuteShouldThrowExceptionIfUserIsNotAdmin()
        {
            _mocker.GetMock <ISecurity>()
            .Setup(p => p.IsAdmin())
            .Returns(false);

            Assert.That(() => _command.Execute(InvoiceId),
                        Throws.TypeOf <UserNotAuthorizedException>());
        }