1 / 7

Testing Mail Template Evaluation with Variable Substitution in TDD

This document illustrates various test cases for evaluating a mail template using test-driven development. It covers the evaluation of templates such as "Hello, ${name}" with the value "Reader" resulting in "Hello, Reader". It also details scenarios where missing or undefined variables lead to errors, like raising a MissingValueError when no value is provided. Additional performance verification includes testing a template with 20 variables to ensure evaluation occurs within 200 milliseconds. This is essential for maintaining template engine performance.

nibal
Télécharger la présentation

Testing Mail Template Evaluation with Variable Substitution in TDD

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. TDD Example Test Driven – Koskela Chapter 2

  2. Mail Template Test List • Evaluating template “Hello, ${name}” with the value “Reader” for variable “name” results in the string “Hello, Reader”. • Evaluating template “${greeting}, ${name}” with the values “Hi” and “Reader”, respectively, results in the string “Hello, Reader”. • Evaluating template “Hello, ${name}” with values “Hi” and “Reader” for variables “doesnotexist” and “name”, respectively, results in the string “Hello, Reader” • Evaluating template “Hello, ${name}” with no value for variable “name” raises a MissingValueError. • Verify that a template of 100 words and 20 variables with values of approximately 15 characters each is evaluated in 200 milliseconds or less. • Evaluate template “${one}, ${two}, ${three}” with values “1”, “${foo}”, and “3”, respectively, and verify that the template engine renders the result as “1, ${foo}, 3”.

  3. Mail Template Test List • Evaluating template “Hello, ${name}” with the value “Reader” for variable “name” results in the string “Hello, Reader”. • Evaluating template “${greeting}, ${name}” with the values “Hi” and “Reader”, respectively, results in the string “Hello, Reader”. • Evaluating template “Hello, ${name}” with values “Hi” and “Reader” for variables “doesnotexist” and “name”, respectively, results in the string “Hello, Reader” • Evaluating template “Hello, ${name}” with no value for variable “name” raises a MissingValueError. • Verify that a template of 100 words and 20 variables with values of approximately 15 characters each is evaluated in 200 milliseconds or less. • Evaluate template “${one}, ${two}, ${three}” with values “1”, “${foo}”, and “3”, respectively, and verify that the template engine renders the result as “1, ${foo}, 3”.

  4. Mail Template Test List • Evaluating template “Hello, ${name}” with the value “Reader” for variable “name” results in the string “Hello, Reader”. • Evaluating template “${greeting}, ${name}” with the values “Hi” and “Reader”, respectively, results in the string “Hello, Reader”. • Evaluating template “Hello, ${name}” with values “Hi” and “Reader” for variables “doesnotexist” and “name”, respectively, results in the string “Hello, Reader” • Evaluating template “Hello, ${name}” with no value for variable “name” raises a MissingValueError. • Verify that a template of 100 words and 20 variables with values of approximately 15 characters each is evaluated in 200 milliseconds or less. • Evaluate template “${one}, ${two}, ${three}” with values “1”, “${foo}”, and “3”, respectively, and verify that the template engine renders the result as “1, ${foo}, 3”.

  5. Mail Template Test List • Evaluating template “Hello, ${name}” with the value “Reader” for variable “name” results in the string “Hello, Reader”. • Evaluating template “${greeting}, ${name}” with the values “Hi” and “Reader”, respectively, results in the string “Hello, Reader”. • Evaluating template “Hello, ${name}” with values “Hi” and “Reader” for variables “doesnotexist” and “name”, respectively, results in the string “Hello, Reader” • Evaluating template “Hello, ${name}” with no value for variable “name” raises a MissingValueError. • Verify that a template of 100 words and 20 variables with values of approximately 15 characters each is evaluated in 200 milliseconds or less. • Evaluate template “${one}, ${two}, ${three}” with values “1”, “${foo}”, and “3”, respectively, and verify that the template engine renders the result as “1, ${foo}, 3”.

  6. Mail Template Test List • Evaluating template “Hello, ${name}” with the value “Reader” for variable “name” results in the string “Hello, Reader”. • Evaluating template “${greeting}, ${name}” with the values “Hi” and “Reader”, respectively, results in the string “Hello, Reader”. • Evaluating template “Hello, ${name}” with values “Hi” and “Reader” for variables “doesnotexist” and “name”, respectively, results in the string “Hello, Reader” • Evaluating template “Hello, ${name}” with no value for variable “name” raises a MissingValueError. • Verify that a template of 100 words and 20 variables with values of approximately 15 characters each is evaluated in 200 milliseconds or less. • Evaluate template “${one}, ${two}, ${three}” with values “1”, “${foo}”, and “3”, respectively, and verify that the template engine renders the result as “1, ${foo}, 3”.

  7. Mail Template Test List • Evaluating template “Hello, ${name}” with the value “Reader” for variable “name” results in the string “Hello, Reader”. • Evaluating template “${greeting}, ${name}” with the values “Hi” and “Reader”, respectively, results in the string “Hello, Reader”. • Evaluating template “Hello, ${name}” with values “Hi” and “Reader” for variables “doesnotexist” and “name”, respectively, results in the string “Hello, Reader” • Evaluating template “Hello, ${name}” with no value for variable “name” raises a MissingValueError. • Verify that a template of 100 words and 20 variables with values of approximately 15 characters each is evaluated in 200 milliseconds or less. • Evaluate template “${one}, ${two}, ${three}” with values “1”, “${foo}”, and “3”, respectively, and verify that the template engine renders the result as “1, ${foo}, 3”.

More Related