Beispiel #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 = ");
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }