Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public void TestInitialize()
 {
     _helper  = new PropertyItemTypesChangedActionHelper();
     _message = new PropertyItemTypesChangedMessage
     {
         IsStandard = true,
         ChangeType = PropertyItemTypeChangeType.ItemType,
         UserId     = 1,
         RevisionId = 2
     };
     _repositoryMock = new Mock <IPropertyItemTypesChangedRepository>(MockBehavior.Strict);
     _workflowMessagingProcessorMock = new Mock <IWorkflowMessagingProcessor>(MockBehavior.Strict);
     _tenantInformation = new TenantInformation();
 }