Skip to content

Instantly share code, notes, and snippets.

@SinisterMinister
Last active December 18, 2015 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SinisterMinister/5783005 to your computer and use it in GitHub Desktop.
Save SinisterMinister/5783005 to your computer and use it in GitHub Desktop.
Unit Tests
Internal Caching
✓ Should throw an exception when trying to get a key that doesn't exist
✓ Should set and retrieve a key from the cache
✓ Should delete a key from the cache
Helpers
hasTagType()
✓ Should return the index of an array where a tag type exists
✓ Should return false if the type is not found
mergeTagsWithDefault()
✓ Should merge two arrays together
✓ Should merge two arrays with conflicting objects with the second taking precedence
flattenTags()
✓ Should convert an array of tags into a string
hashCode()
✓ Should return a hash from a string
✓ Should be idempotent (1,000 tests)
Unit Tests
Internal Caching
◦ Should throw an exception when trying to get a key that do ✓ Should throw an exception when trying to get a key that doesn't exist
✓ Should set and retrieve a key from the cache
✓ Should delete a key from the cache
Helpers
hasTagType()
◦ Should return the index of an array where a tag type exi ✓ Should return the index of an array where a tag type exists
✓ Should return false if the type is not found
mergeTagsWithDefault()
✓ Should merge two arrays together
◦ Should merge two arrays with conflicting objects with th ✓ Should merge two arrays with conflicting objects with the second taking precedence
flattenTags()
✓ Should convert an array of tags into a string
hashCode()
✓ Should return a hash from a string
✓ Should be idempotent (1,000 tests)
10 tests complete (13 ms)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment