Beispiel #1
0
        public void Constructor_WithArguments_ExpectedValues()
        {
            // Setup
            var mocks         = new MockRepository();
            var inquiryHelper = mocks.Stub <IInquiryHelper>();

            mocks.ReplayAll();

            // Call
            var handler = new TestClearIllustrationPointsOfCalculationCollectionChangeHandler(inquiryHelper);

            // Assert
            Assert.IsInstanceOf <IClearIllustrationPointsOfCalculationCollectionChangeHandler>(handler);
            mocks.VerifyAll();
        }
Beispiel #2
0
        public void InquireConfirmation_Always_UsesExpectedInquiryAndReturnsExpectedConfirmation(bool expectedConfirmation)
        {
            // Setup
            const string confirmationMessage = "Inquiry";

            var mocks         = new MockRepository();
            var inquiryHelper = mocks.StrictMock <IInquiryHelper>();

            inquiryHelper.Expect(h => h.InquireContinuation(confirmationMessage)).Return(expectedConfirmation);
            mocks.ReplayAll();

            var handler = new TestClearIllustrationPointsOfCalculationCollectionChangeHandler(inquiryHelper)
            {
                ConfirmationMessage = confirmationMessage
            };

            // Call
            bool confirmation = handler.InquireConfirmation();

            // Assert
            Assert.IsTrue(handler.GetConfirmationMessageCalled);
            Assert.AreEqual(expectedConfirmation, confirmation);
            mocks.VerifyAll();
        }