public void Describe() { var testee = new InlineExpression <TestQuestion, string, int>(this.question, (q, p) => AResult); string description = testee.Describe(); description.Should().StartWith("inline expression = "); }
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); }
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); }
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); }