Giter Site home page Giter Site logo

unitteststutorial's Introduction

UnitTestsTutorial

Code samples for Unit Testing for Unity tutorial.

Read the full tutorial:

https://www.jonathanyu.xyz/2018/11/24/unit-testing-in-unity/

I consider automated tests to be a cornerstone of building high quality software. Testing should be taken seriously in all aspects of software development and creating games in Unity should be no exception. In this post I'll focus on the unit testing aspect of test driven development (TDD).

I've found that Unity resources and tutorials rarely stress the importance of tests. This post is meant to act as an introduction to unit testing and provide some samples on how to write unit tests for Unity in C#. Unit tests in a nutshell

On the surface unit testing is just a method of testing software. Unit refers to the smallest testable part of an application. In Unity C# (or in most OOP languages), the smallest testable part is an individual method. Each method has some functionality and the test is written to assert the expected behavior.

Unit tests are written independent from other parts of the code base. Dependencies on other classes should be substituted or mocked. This forms the basis of why unit tests push developers to create decoupled code. Tightly coupled interfaces make for a large number of dependencies and make testing difficult.

Dependencies:

NUnit
Unity 2018.2

unitteststutorial's People

Contributors

xjjon avatar

Stargazers

Utkarsh Raj avatar

Watchers

James Cloos avatar  avatar

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.