Exemple #1
0
        public void IsMessageBoundary_NoMessageTransitions_ReturnsFalse(bool firstTransition, bool secondTransition)
        {
            Mock <ITokenStateTransition> firstStub  = new Mock <ITokenStateTransition>();
            Mock <ITokenStateTransition> secondStub = new Mock <ITokenStateTransition>();

            firstStub.Setup(transition => transition.IsMessageBegin()).Returns(firstTransition);
            secondStub.Setup(transition => transition.IsMessageEnd()).Returns(secondTransition);

            bool isMessageBoundary = TokenStateTransition.IsMessageBoundary(firstStub.Object, secondStub.Object);

            Assert.IsFalse(isMessageBoundary);
        }
Exemple #2
0
        public void IsMessageBoundary_WithMessageTransitions_ReturnsTrue()
        {
            Mock <ITokenStateTransition> firstStub  = new Mock <ITokenStateTransition>();
            Mock <ITokenStateTransition> secondStub = new Mock <ITokenStateTransition>();

            firstStub.Setup(transition => transition.IsMessageBegin()).Returns(true);
            secondStub.Setup(transition => transition.IsMessageEnd()).Returns(true);

            bool isMessageBoundary = TokenStateTransition.IsMessageBoundary(firstStub.Object, secondStub.Object);

            Assert.IsTrue(isMessageBoundary);
        }