Example #1
0
        public void CanonicalTestWithParameterizedStub()
        {
            const int    knownValue = 2;
            TestedObject tested     = new TestedObject(new ParameterizedStub(knownValue));

            Assert.AreEqual(knownValue * 42, tested.ComputeSomething());
        }
Example #2
0
        public void CanonicalTest()
        {
            var tested = new TestedObject(new ConcreteCollaborator());

            // In the book, this line appears as assertEquals(?, tested.ComputeSomething());
            Assert.AreEqual(1, tested.ComputeSomething());
        }
Example #3
0
        public void CanonicalTestWithStub()
        {
            var tested = new TestedObject(new CollaboratorStub());

            Assert.AreEqual(420, tested.ComputeSomething());
        }