Defining RecordedCall in a TestProcessor

 Given a TestProcessor
 Should lookup RecordedCalls in a Log

Test Code

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

        [TestMethod]
        public void Should_lookup_RecorderCalls_in_a_Log() {

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

Production Code

    public class 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 4:40 AM by mikemps, version 3

Comments

No comments yet.