Skip to content

Files

Latest commit

 

History

History
30 lines (24 loc) · 1.74 KB

README.md

File metadata and controls

30 lines (24 loc) · 1.74 KB

TDD Workshop

CircleCI

❓ What is this?

A small API for mutating strings.

‼️ The problem

Some of our tests started failing, upon investigating the cause we've found that some of our core functions have disappeared. We have only one hope to save our API - Test-Driven Development!

📋 Requirements

  • Reverse must reverse the sequence - Reverse("ABCD") == "DCBA"
  • Count must return the number of elements in the sequence - Count("ABCD") == 4
  • Separate must return the sequence with each element comma separated - Separate("ABCD") == "A,B,C,D"
  • EncodeBase64 must encode the sequence to valid Base64 string - EncodeBase64("ABCD") == "QUJDRA=="
  • DecodeBase64 must decode a Base64-encoded sequence to a regular string - DecodeBase64("QUJDRA==") == "ABCD"
  • EncodeShiftLeft must shift the sequence left N number of times - EncodeShiftLeft("ABCD", 2) == "CDAB"
  • DecodeShiftLeft must reverse the shifting of sequence left N number of times - DecodeShiftLeft("CDAB", 2) == "ABCD"
  • EncodeShiftRight must shift the sequence right, N number of times - EncodeShiftRight("ABCD", 3) == "CDBA"
  • DecodeShiftRight must reverse the shifting of sequence right N number of times - DecodeShiftRight("CDBA", 3) == "ABCD"

📦 Installation

From the CLI, execute

  • git clone https://github.com/burtawicz/tdd-workshop-go to clone the repository to your machine
  • cd tdd-workshop-go to enter the project directory
  • go build to build the project

⚗️ Running the tests

From the CLI, execute go test