예제 #1
0
        public void Describe()
        {
            var testee = new InlineExpression <TestQuestion, string, int>(this.question, (q, p) => AResult);

            string description = testee.Describe();

            description.Should().StartWith("inline expression = ");
        }
예제 #2
0
        public void EvaluatesFunc()
        {
            const int Result = 3;

            var testee = new InlineExpression <TestQuestion, string, int>(this.question, (q, p) => Result);

            int answer = testee.Evaluate(AParameter);

            answer.Should().Be(Result);
        }
예제 #3
0
        public void PassesQuestionToFunc()
        {
            TestQuestion receivedQuestion = null;

            var testee = new InlineExpression <TestQuestion, string, int>(
                this.question,
                (q, p) => this.InterceptQuestion(q, p, out receivedQuestion));

            testee.Evaluate(AParameter);

            receivedQuestion.Should().BeSameAs(this.question);
        }
예제 #4
0
        public void PassesParameterToFunc()
        {
            const string Parameter = "Parameter";

            string receivedParameter = null;

            var testee = new InlineExpression <TestQuestion, string, int>(
                this.question,
                (q, p) => this.InterceptParameter(q, p, out receivedParameter));

            testee.Evaluate(Parameter);

            receivedParameter.Should().Be(Parameter);
        }