Companies Home Search Profile

Introduction to Testing in Go (Golang)

Focused View

Trevor Sawler

12:15:39

176 View
  • 1. Introduction.mp4
    05:33
  • 2. About me.mp4
    01:01
  • 3. Asking for help.mp4
    01:14
  • 4. Mistakes. We all make them..mp4
    01:06
  • 1. What well cover in this section.mp4
    00:29
  • 2.1 Go.html
  • 2. Installing Go.mp4
    01:27
  • 3.1 Download VS Code.html
  • 3. Installing an IDE.mp4
    01:28
  • 4.1 Docker.html
  • 4. Installing Docker.mp4
    00:51
  • 1. What well cover in this section.mp4
    01:03
  • 2.1 primeapp.zip
  • 2. Creating a simple command line application.mp4
    06:20
  • 3.1 primeapp.zip
  • 3. Writing a test for the isPrime() function.mp4
    07:57
  • 4.1 primeapp.zip
  • 4. Improving our test with table tests.mp4
    07:20
  • 5. Checking test coverage.mp4
    02:29
  • 6.1 primeapp.zip
  • 6. Completing our table tests.mp4
    02:48
  • 7.1 primeapp.zip
  • 7. Improving our program to allow for user entered information.mp4
    11:25
  • 8.1 primeapp.zip
  • 8. Writing a test for the prompt() function.mp4
    07:09
  • 9.1 primeapp.zip
  • 9. Writing a test for the intro() function.mp4
    02:29
  • 10.1 primeapp.zip
  • 10. Testing user input - writing a test for the checkNumbers() function.mp4
    13:35
  • 11.1 primeapp.zip
  • 11. Updating readUserInput to make it testable, and then testing it.mp4
    05:56
  • 1. What well cover in this section.mp4
    00:44
  • 2. Running a single test.mp4
    01:37
  • 3. Running groups of tests (test suites).mp4
    01:59
  • 1. What well cover in this section.mp4
    00:42
  • 2.1 webapp.zip
  • 2. Creating a simple web app.mp4
    10:15
  • 3.1 webapp.zip
  • 3. Setting up a route and handler for the home page.mp4
    11:59
  • 4.1 webapp.zip
  • 4. Testing our application routes.mp4
    11:28
  • 5.1 webapp.zip
  • 5. Testing Handlers the Home handler.mp4
    10:00
  • 6.1 webapp.zip
  • 6. Setting up some simple middleware.mp4
    12:22
  • 7.1 webapp.zip
  • 7. Trying out our new addIPToContext middleware.mp4
    02:45
  • 8.1 webapp.zip
  • 8. Testing our middleware.mp4
    12:11
  • 9.1 webapp.zip
  • 9. Testing ipFromContext.mp4
    04:29
  • 10.1 webapp.zip
  • 10. Creating a login form.mp4
    02:56
  • 11.1 webapp.zip
  • 11. Setting up a route and stub handler for the login form.mp4
    04:43
  • 1. What well cover in this section.mp4
    00:34
  • 2.1 webapp.zip
  • 2. Setting up validation logic.mp4
    09:32
  • 3.1 webapp.zip
  • 3. Testing validation logic.mp4
    08:24
  • 4.1 webapp.zip
  • 4. Completing the tests for our validation logic.mp4
    05:18
  • 5.1 webapp.zip
  • 5. Trying out validation with our login form.mp4
    03:26
  • 1. What well cover in this section.mp4
    00:55
  • 2.1 webapp.zip
  • 2. Setting up a test enviroment with testing.M.mp4
    04:28
  • 3.1 webapp.zip
  • 3. Simplifying our templates using a layout.mp4
    04:25
  • 4.1 scs on GitHub.html
  • 4.2 webapp.zip
  • 4. Installing a sessions package.mp4
    02:01
  • 5.1 webapp.zip
  • 5. Adding session to App config, and creating a SessionManager.mp4
    04:10
  • 6.1 webapp.zip
  • 6. Trying out our sessions.mp4
    07:38
  • 7.1 webapp.zip
  • 7. Updating our tests.mp4
    11:47
  • 8.1 webapp.zip
  • 8. Improving our test for the Home handler.mp4
    06:18
  • 9.1 webapp.zip
  • 9. Testing the render function with a bad template.mp4
    07:35
  • 1. What well cover in this section.mp4
    01:13
  • 2.1 Beekeeper Studio.html
  • 2.2 docker.zip
  • 2. Installing postgres with Docker.mp4
    06:05
  • 3.1 jackpgx.html
  • 3.2 webapp.zip
  • 3. Setting up a database connection.mp4
    10:26
  • 4.1 pkg.zip
  • 4.2 webapp.zip
  • 4. Adding the data package for models and db package for database access.mp4
    04:02
  • 5.1 webapp.zip
  • 5. Making sure our web app can connect to our database.mp4
    03:34
  • 6.1 webapp.zip
  • 6. Closing our database pool gracefully, and resetting template path in tests.mp4
    01:57
  • 7.1 webapp.zip
  • 7. Creating a stub profile page.mp4
    08:28
  • 8.1 webapp.zip
  • 8. Adding messages to our template data and template files.mp4
    06:53
  • 9.1 webapp.zip
  • 9. Adding true authenication to the Login handler.mp4
    05:32
  • 10.1 webapp.zip
  • 10. Testing the Login handler.mp4
    19:17
  • 11.1 webapp.zip
  • 11. Adding Auth middleware.mp4
    04:24
  • 12.1 webapp.zip
  • 12. Testing Auth middleware.mp4
    06:53
  • 13.1 webapp.zip
  • 13. Updating routes & end-to-end tests.mp4
    09:28
  • 14.1 webapp.zip
  • 14. Problems with our Login handler test.mp4
    01:56
  • 1. What well cover in this section.mp4
    02:12
  • 2.1 webapp.zip
  • 2. Defining an interface type for our repository.mp4
    03:27
  • 3.1 webapp.zip
  • 3. Moving our database functions into a repository.mp4
    05:01
  • 4.1 webapp.zip
  • 4. Updating application config to use the database repository.mp4
    02:19
  • 5.1 webapp.zip
  • 5. Creating a testdb repository.mp4
    05:49
  • 6.1 webapp.zip
  • 6. Updating setup_test.go to use the test repository.mp4
    01:58
  • 7.1 webapp.zip
  • 7. Updating our tests to use the testdb repository.mp4
    04:32
  • 1. What well cover in this section.mp4
    01:22
  • 2.1 dockertest on GitHub.html
  • 2.2 webapp.zip
  • 2. Getting started with testing our database.mp4
    08:05
  • 3.1 webapp.zip
  • 3. Getting our tests to spin up a docker image with Postgres.mp4
    11:03
  • 4.1 webapp.zip
  • 4. Populating our test database with empty tables.mp4
    08:53
  • 5.1 webapp.zip
  • 5. Testing InsertUser.mp4
    06:21
  • 6.1 webapp.zip
  • 6. Testing AllUsers.mp4
    04:09
  • 7.1 webapp.zip
  • 7. Testing GetUser and GetUserByEmail.mp4
    05:11
  • 8.1 webapp.zip
  • 8. Testing UpdateUser.mp4
    04:21
  • 9.1 webapp.zip
  • 9. Testing DeleteUser.mp4
    02:33
  • 10.1 webapp.zip
  • 10. Testing ResetUserPassword.mp4
    04:13
  • 11.1 webapp.zip
  • 11. Testing InsertUserImage.mp4
    06:35
  • 12.1 webapp.zip
  • 12. Using build tags to separate our integration tests.mp4
    02:55
  • 1. What well cover in this section.mp4
    00:56
  • 2.1 webapp.zip
  • 2. Adding a form to the Profile page.mp4
    05:43
  • 3.1 webapp.zip
  • 3. Adding the UserImage type to the User type.mp4
    05:41
  • 4.1 webapp.zip
  • 4. Updating the profile.page.gohtml file to look for a profile image.mp4
    06:52
  • 5.1 webapp.zip
  • 5. Writing a stub handler and a function to process profile image uploads.mp4
    14:28
  • 6.1 webapp.zip
  • 6. Implementing the UploadProfilePic handler.mp4
    04:50
  • 7.1 webapp.zip
  • 7. Trying things out.mp4
    04:27
  • 8.1 img.png.zip
  • 8.2 webapp.zip
  • 8. Testing image uploads.mp4
    15:21
  • 9.1 webapp.zip
  • 9. Testing our upload handler, with an alternative approach.mp4
    09:51
  • 1. What well cover in this section.mp4
    01:29
  • 2.1 webapp.zip
  • 2. Setting up an api with our existing code base.mp4
    09:54
  • 3.1 webapp.zip
  • 3. Adding stub handlers (endpoints) for our API.mp4
    05:48
  • 4.1 utilities.go.zip
  • 4.2 webapp.zip
  • 4. Trying out our REST API to make sure things work.mp4
    05:22
  • 5.1 webapp.zip
  • 5. Getting started with JWT Authentication.mp4
    19:03
  • 6.1 webapp.zip
  • 6. Generating token pairs.mp4
    10:38
  • 7.1 webapp.zip
  • 7. Implementing the authenticate handler.mp4
    04:49
  • 8.1 curl-command.txt.zip
  • 8. Trying out the authentication handler.mp4
    04:52
  • 9.1 webapp.zip
  • 9. Testing our authentication handler.mp4
    10:50
  • 10.1 main.go.zip
  • 10.2 webapp.zip
  • 10. Setting up a simple program to generate tokens for testing.mp4
    02:38
  • 11.1 webapp.zip
  • 11. Testing generating and validating tokens.mp4
    15:36
  • 12.1 webapp.zip
  • 12. Setting up our application middleware.mp4
    06:39
  • 13.1 webapp.zip
  • 13. Testing our CORS middleware.mp4
    07:02
  • 14.1 webapp.zip
  • 14. Testing our authRequired middleware.mp4
    08:17
  • 15.1 webapp.zip
  • 15. Add middleware to routes.mp4
    02:15
  • 16.1 webapp.zip
  • 16. Testing API routes.mp4
    03:55
  • 17.1 webapp.zip
  • 17. Implementing the handler to refresh tokens.mp4
    09:40
  • 18.1 webapp.zip
  • 18. Testing refreshing tokens.mp4
    13:12
  • 19.1 webapp.zip
  • 19. Completing the handlers that interact with the User type.mp4
    07:21
  • 20.1 webapp.zip
  • 20. Testing the handlers that interact with the User type.mp4
    11:55
  • 21.1 webapp.zip
  • 21. Finishing up testing handlers that interact with the data.User type.mp4
    08:54
  • 1. What well cover in this section.mp4
    01:20
  • 2.1 index.html.zip
  • 2.2 webapp.zip
  • 2. Serving HTML for our SPA.mp4
    05:17
  • 3.1 webapp.zip
  • 3. Authenticating users with our SPA.mp4
    16:15
  • 4.1 webapp.zip
  • 4. Setting a refresh token cookie when authenticating.mp4
    08:39
  • 5.1 webapp.zip
  • 5. Allowing users to refresh tokens using a cookie.mp4
    06:23
  • 6.1 webapp.zip
  • 6. Automatically refreshing tokens while the user is logged in.mp4
    05:53
  • 7.1 webapp.zip
  • 7. Getting a user from our simple SPA with the Get User button.mp4
    04:36
  • 8.1 webapp.zip
  • 8. Logging web users out.mp4
    06:00
  • 9.1 webapp.zip
  • 9. Testing refreshing tokens for Single Page Apps.mp4
    08:58
  • 10.1 webapp.zip
  • 10. Testing logging users out of our SPA.mp4
    06:32
  • Description


    Learn how to write effective unit and integration tests in Go, for web applications and REST APIs

    What You'll Learn?


    • Learn how to write unit tests in Go
    • Learn how to write integration tests in Go, and simplify them using Docker
    • Learn how to create test suites in Go
    • Learn how to create a simple web application and test handlers, middleware, database, and more
    • Learn how to create a simple REST API in Go and test its endpoints
    • Learn to to authenticate using JWT Tokens (and refresh tokens) and completely test all functionality
    • Learn how to write tests that cover multiple scenarios with table tests

    Who is this for?


  • Developers working in Go who want to level up their testing skills
  • What You Need to Know?


  • A basic understanding of to use Go programming language
  • More details


    Description

    Writing unit tests and integration tests is one of the most-neglected aspects of software development. All too often, a developer will find him or herself say "but it works on my computer!" when a project is presumed finished, only to discover that once taken out of the development environment, things don't work as expected.

    Well written unit tests and integration tests help to solve this problem, and in fact almost without exception will reduce overall development time, rather than adding to it. In addition, well-tested code almost always requires less maintenance, and the end product will have less down time.

    This course is focused on writing unit and integration tests in Go, a modern, type safe, compiled, and extremely fast programming language. It it is ideally suited for building safe, scalable, incredibly fast web applications, and it has powerful testing tools built right in.

    In this course, we will build four simple applications, and thoroughly test them:

    • A command line application (CLI) that tries to determine if a user-entered number is prime or not;

    • A simple web application that allows a user to log in and upload a profile picture;

    • A simple REST API built on the same code base as the web application which allows users to authenticate using JWT tokens and perform operations against a Postgres database. We'll go through the entire authentication process, including using refresh tokens, and thoroughly test all aspects of the code.

    • A simple Single Page Web Application (SPA), written in Vanilla JavaScript, that demonstrates how to use JWT and Refresh Tokens with a SPA, and how to test that functionality.

    For each of these projects, we will learn how to write unit tests for all functionality. We will learn how to test (among other things):

    • Application routes

    • Application handlers

    • How to test multiple scenarios by writing and using table tests

    • Database operations (using the Repository pattern)

    • Application middleware

    • User authentication (with sessions)

    • User authentication (with JWT tokens)

    • JWT token generation and validation

    • Refresh token generation and validation

    • Testing user input

    • Writing to the terminal

    • Adding cookies to a request

    • Reading cookies from a response

    By the end of this course, you will have a solid understanding of how to write effective tests, and how to write testable code.

    Who this course is for:

    • Developers working in Go who want to level up their testing skills

    User Reviews
    Rating
    0
    0
    0
    0
    0
    average 0
    Total votes0
    Focused display
    Category
    Trevor Sawler
    Trevor Sawler
    Instructor's Courses
    I have twenty years of experience in professional software development, and twenty years of experience as a University professor. As an entrepreneur, I have worked with a broad range of clients, including Thomson Nelson, Hewlett Packard, the Royal Bank of Canada, Keybank, Sprint, and many, many others. I also have extensive management and project management experience. I have led teams of fifty developers and artists on multi-million dollar projects, and much smaller teams on much smaller projects.As a professor, I have taught in a wide variety of course areas, including Computer Science, English, Irish, and American literature, and a number of "crossover" courses that bridge the liberal arts and technological fields.I have won regional, national, and international awards for my work in the IT field, and have also won awards for my teaching and research as a University professor.
    Students take courses primarily to improve job-related skills.Some courses generate credit toward technical certification. Udemy has made a special effort to attract corporate trainers seeking to create coursework for employees of their company.
    • language english
    • Training sessions 120
    • duration 12:15:39
    • Release Date 2022/12/03