https://github.com/ipuldev/simple-golang-mock-unit-test
SImple golang unit testing using mock schema
https://github.com/ipuldev/simple-golang-mock-unit-test
Last synced: 8 months ago
JSON representation
SImple golang unit testing using mock schema
- Host: GitHub
- URL: https://github.com/ipuldev/simple-golang-mock-unit-test
- Owner: ipuldev
- License: mit
- Created: 2022-10-27T18:54:05.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-02T16:23:08.000Z (over 3 years ago)
- Last Synced: 2025-02-03T09:57:50.360Z (over 1 year ago)
- Language: Go
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![MIT License][license-shield]][license-url]
Table of Contents
## 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][wikipedia-mock]
In this project we implement simple example of mocking schema using golang unit test.
### Built With
* [![Go][Go.com]][Go-url]
## Usage
1. ```go test ./...```
## 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
## License
Distributed under the MIT License. See `LICENSE.txt` for more information.
[GO.com]:https://img.shields.io/badge/GO%20-0769AD?style=flat&logo=go&logoColor=white
[GO-Url]:https://go.dev/
[license-shield]: https://img.shields.io/github/license/briankliwon/algorithm-go
[license-url]: https://github.com/briankliwon/algorithm-go/blob/main/LICENSE
[wikipedia-mock]:https://en.wikipedia.org/wiki/Mock_object