Esempio n. 1
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);
        }
Esempio n. 2
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);
        }
Esempio n. 3
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);
        }