Skip to content

g33klady/TodoApiSample

Repository files navigation

Testing RESTful Web Services 1/2 Day Workshop Code & Resources

Prerequisites

For this workshop, you need the following knowledge:

  • 101 level knowledge of C#
  • 101 level Git knowledge (to manage with the repo and branches)

This workshop requires the following:

Have Some Cake With Your Frosting: Testing The UI and API Layers

Prerequisites

For this workshop, no prior knowledge is required. However, the following are required to be installed:

Resources

Some resources mentioned or useful during the workshops:

To Use This Application In Docker

The application can also be used in Docker, for instance for the Workshop "Have Some Cake With Your Frosting"

  • Install and setup Docker (https://www.docker.com/community-edition)
  • If using Docker on Windows, set Docker to use Linux Containers - either during installation or by right-clicking on the Docker icon in the system tray and choosing Switch to Linux Containers (you can switch back after the workshop)
  • Verify your installation (https://docs.docker.com/get-started/#test-docker-installation)
  • Run the following command from a command line anywhere on your computer docker run -p 8080:80 --name myapp g33klady/todoapi:latest This will get the latest docker image with this code running on your machine

To see what is running in Docker Docker ps

To stop a Docker image Docker stop myapp

To start a Docker image back up Docker start myapp

Once Docker is running, application can be accessed: http://localhost:8080

Note

You'll need to provide a header with key "CanAccess" and value "true" to use the API via Postman. When using the Swagger specification, select the Authorization button and enter the value "true".

Automated Test Samples

To view some automated tests written in C#, review the branch "Exercise 5". To view the above automated tests using RestSharp, review the branch "RestSharp".