Coder Social home page Coder Social logo

go-testing-playground's Introduction

go-testing-playground

This is for practicing how to make tests. If you think it's about swings, then you're out of luck.

go-testing-playground's People

Contributors

ephraimb avatar sherzberg avatar

Watchers

 avatar  avatar

go-testing-playground's Issues

Add an additional handler

The handler should accept a query string parameter named "search" and the handler should return a json list of search results, this list can be anything for now. You need to add a few tests for this. One for returning a 400 status code if they don't supply the search query string parameter and one for a valid response.

  • The handler should return 400 if the search query parameter is not provided. write a test for this
  • The handler should return a fake list of results in json format. write a test for this

Create a postgres Repository

  • Use docker-compose to setup a postgres database in docker
  • Create a table called books with a single column for title
  • Implement a PostgresRepository to search the table above
  • Implement a test that mocks the postgres queries

Setup a webserver to use the search handler

  • create a search http handler that accepts a query query string parameter. the response should be json
  • setup the handler to use the postgres repository
  • create several tests for the handler (no query, no results, several results)

Make calculation functions

Make calculation functions and write tests for them. These functions should take two parameters each, x and y.

  • Addition
  • Subtraction
  • Multiplication

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.