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

            mocks.ReplayAll();

            // Call
            var handler = new TestClearIllustrationPointsOfCalculationChangeHandler(inquiryHelper, new TestCalculation());

            // Assert
            Assert.IsInstanceOf <IClearIllustrationPointsOfCalculationChangeHandler>(handler);
            mocks.VerifyAll();
        }
Esempio n. 2
0
        public void InquireConfirmation_Always_DisplaysInquiryAndReturnsConfirmation(bool expectedConfirmation)
        {
            // Setup
            const string expectedInquiry = "Weet u zeker dat u de illustratiepunten van deze berekening wilt wissen?";

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

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

            var handler = new TestClearIllustrationPointsOfCalculationChangeHandler(inquiryHelper, new TestCalculation());

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

            // Assert
            Assert.AreEqual(expectedConfirmation, confirmation);
            mocks.ReplayAll();
        }
Esempio n. 3
0
        public void DoPostUpdateActions_Always_NotifiesCalculationObservers()
        {
            // Setup
            var mocks         = new MockRepository();
            var inquiryHelper = mocks.StrictMock <IInquiryHelper>();
            var observer      = mocks.StrictMock <IObserver>();

            observer.Expect(o => o.UpdateObserver());
            mocks.ReplayAll();

            var calculation = new TestCalculation();

            calculation.Attach(observer);

            var handler = new TestClearIllustrationPointsOfCalculationChangeHandler(inquiryHelper, calculation);

            // Call
            handler.DoPostUpdateActions();

            // Assert
            mocks.VerifyAll();
        }