Skip to content

ipuldev/simple-golang-mock-unit-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIT License

Table of Contents
  1. About The Project
  2. Usage
  3. Contributing
  4. License

About The Project

How we handle unit testing when function must be connect to database or third party service, that is so complicated case when we have to connect database first etc. How to make it to be more simple ?..let see mocking

What is mock In object-oriented programming, mock objects are simulated objects that mimic the behaviour of real objects in controlled ways, most often as part of a software testing initiative. A programmer typically creates a mock object to test the behaviour of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behaviour of a human in vehicle impacts. The technique is also applicable in generic programming. wikipedia

In this project we implement simple example of mocking schema using golang unit test.

(back to top)

Built With

  • Go

(back to top)

Usage

  1. go test ./...

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/[FEATURE])
  3. Commit your Changes (git commit -m 'Add some [FEATURE]')
  4. Push to the Branch (git push origin feature/[FEATURE])
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

About

SImple golang unit testing using mock schema

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages