Defining RecordedCall in a TestProcessor

 Given a TestProcessor
 Should lookup RecordedCalls in a Log

Test Code

    [TestClass]
    public class Given_TestProcessor : BehaviorOf<TestProcessorClass> {

        [TestMethod]
        public void Should_lookup_RecorderCalls_in_a_Log() {

            Given.Log.Recorded(Expected.Call).WillReturn(true);
            Assert.IsTrue(That.RecordedCall);
        }
    }

Production Code

    public class TestProcessorClass : TestProcessor {

        public Log Log { get; set; }
        public Call Call { get; set; }

        public bool RecordedCall {
            get { return Log.Recorded(Call); }
        }
    }

    public interface Log {

        bool Recorded(Call Call);
    }

    public interface Call {}

Last edited Nov 5, 2008 at 5:22 AM by mikemps, version 1

Comments

No comments yet.