コード例 #1
0
ファイル: HandlerTests.cs プロジェクト: ogolikhin/blueprint
        public void PropertyItemTypesChangedMessageHandler_RethrowsException()
        {
            // arrange
            _actionHelperMock.Setup(m => m.HandleAction(It.IsAny <TenantInformation>(), It.IsAny <ActionMessage>(), It.IsAny <BaseRepository>())).Throws(new TestException());
            var handler = new PropertyItemTypesChangedMessageHandler(_actionHelperMock.Object, _tenantInfoRetrieverMock.Object, _configHelperMock.Object, _transactionValidatorMock.Object);
            var message = new PropertyItemTypesChangedMessage();

            // act
            TestHandlerAndMessageWithHeader(handler, message);
            // assert
            _actionHelperMock.Verify(m => m.HandleAction(It.IsAny <TenantInformation>(), It.IsAny <ActionMessage>(), It.IsAny <BaseRepository>()), Times.Once);
        }
コード例 #2
0
ファイル: HandlerTests.cs プロジェクト: ogolikhin/blueprint
        public void PropertyItemTypesChangedMessageHandler_HandlesMessageSuccessfully()
        {
            // arrange
            _actionHelperMock.Setup(m => m.HandleAction(It.IsAny <TenantInformation>(), It.IsAny <ActionMessage>(), It.IsAny <BaseRepository>())).Returns(Task.FromResult(true));
            var handler = new PropertyItemTypesChangedMessageHandler(_actionHelperMock.Object, _tenantInfoRetrieverMock.Object, _configHelperMock.Object, _transactionValidatorMock.Object);
            var message = new PropertyItemTypesChangedMessage();

            // act
            TestHandlerAndMessageWithHeader(handler, message);
            // assert
            Assert.IsNotNull(handler);
            _actionHelperMock.Verify(m => m.HandleAction(It.IsAny <TenantInformation>(), It.IsAny <ActionMessage>(), It.IsAny <BaseRepository>()), Times.Once);
        }