public void Constructor_GivenNullPassTransformer_ThrowsException()
        {
            mocks.ReplayAll();

            ITransformer nullTransformer = null;

            PredicatedTransformer transformer = new PredicatedTransformer(mockPredicateProvider.Test, nullTransformer, mockFailTransformer);

            mocks.VerifyAll();
        }
        public void Constructor_GivenNullPredicate_ThrowsException()
        {
            Predicate <Int32> nullTest = null;

            mocks.ReplayAll();

            PredicatedTransformer transformer = new PredicatedTransformer(nullTest, mockPassTransformer, mockFailTransformer);

            mocks.VerifyAll();
        }
        public void Transform_TestFails_CallsFailingTransform()
        {
            int dummyNumber = 5;

            Expect.Call(mockPredicateProvider.Test(dummyNumber)).Return(false);
            string expectedResult = "Fails";

            Expect.Call(mockFailTransformer.Transform(dummyNumber)).Return(expectedResult);

            mocks.ReplayAll();

            PredicatedTransformer transformer = new PredicatedTransformer(mockPredicateProvider.Test,
                                                                          mockPassTransformer,
                                                                          mockFailTransformer);
            string actualResult = transformer.Transform(dummyNumber);

            Assert.AreEqual(expectedResult, actualResult);

            mocks.VerifyAll();
        }