Esempio n. 1
0
        public void GetEventActionNullArgumentsTest()
        {
            //Act
            var dataEventHandler = new DataEventActions(fakeSitefinityDataEventProxy);

            //Asserts
            Assert.Throws <ArgumentNullException>(() => dataEventHandler.GetEventAction(null));
        }
Esempio n. 2
0
        public void GetEventActionTest(MicroServicesDataEventAction expectedAction, string eventAction, string workflowState, RecycleBinAction recycleBinAction)
        {
            //Setup
            A.CallTo(() => fakeDataEvent.Action).Returns(eventAction);
            A.CallTo(() => fakeSitefinityDataEventProxy.GetPropertyValue <string>(fakeDataEvent, Constants.ApprovalWorkflowState)).Returns(workflowState);
            A.CallTo(() => fakeSitefinityDataEventProxy.GetPropertyValue <RecycleBinAction>(fakeDataEvent, Constants.RecycleBinAction)).Returns(recycleBinAction);
            A.CallTo(() => fakeSitefinityDataEventProxy.GetPropertyValue <string>(fakeDataEvent, Constants.ItemStatus)).Returns(Constants.ItemStatusLive);

            //Act
            var dataEventHandler = new DataEventActions(fakeSitefinityDataEventProxy);
            var result           = dataEventHandler.GetEventAction(fakeDataEvent);

            //Asserts
            result.Should().Be(expectedAction);
        }
Esempio n. 3
0
        public void ShouldExportPageTest(bool expectedResult, bool propertiesChanged, bool hasPageChanged)
        {
            //Setup
            var dummyChangedProperties = new Dictionary <string, PropertyChange>();

            if (propertiesChanged)
            {
                dummyChangedProperties.Add("PropertyKey", new PropertyChange()
                {
                    NewValue = $"New Text"
                });
            }

            A.CallTo(() => fakeSitefinityDataEventProxy.GetPropertyValue <IDictionary <string, PropertyChange> >(fakeDataEvent, Constants.ChangedProperties)).Returns(dummyChangedProperties);
            A.CallTo(() => fakeSitefinityDataEventProxy.GetPropertyValue <bool>(fakeDataEvent, Constants.HasPageDataChanged)).Returns(hasPageChanged);

            //Act
            var dataEventHandler = new DataEventActions(fakeSitefinityDataEventProxy);
            var result           = dataEventHandler.ShouldExportPage(fakeDataEvent);

            //Asserts
            result.Should().Be(expectedResult);
        }