示例#1
0
        public void UnitTestFramework_TellMessageAndWaitForExceptionNoSenderWithNullMessage_ThrowsArgumentNullException()
        {
            //arrange
            UnitTestFramework <DummyActor> sut = CreateUnitTestFramework();

            //act
            Action act = () => sut.TellMessageAndWaitForException <object>(null);

            //assert
            act.Should().Throw <ArgumentNullException>();
        }
        public void SutActor_ReceiveExceptionMessage_ThrowsSameException()
        {
            //arrange
            Exception message = new ArithmeticException();
            UnitTestFramework <SutActor> framework = UnitTestFrameworkSettings
                                                     .Empty
                                                     .CreateFramework <SutActor>(this);

            //act
            framework.TellMessageAndWaitForException(message);

            //assert
            framework.UnhandledExceptions.First().Should().BeSameAs(message);
        }
示例#3
0
        public void UnitTestFramework_TellMessageAndWaitForException_InvokesTellWaiter()
        {
            //arrange
            UnitTestFramework <DummyActor> sut = CreateUnitTestFramework();

            //act
            sut.TellMessageAndWaitForException(Message, Sender);

            //assert
            TellWaiterMock.Verify(
                teller => teller.TellMessage(
                    ExceptionWaiter,
                    this,
                    SutActor,
                    Message,
                    1,
                    Sender),
                Times.Once);
        }