GithubHelp home page GithubHelp logo

hraytilakhealthcare / unityspec Goto Github PK

View Code? Open in Web Editor NEW

This project forked from unityspec/unityspec

0.0 0.0 0.0 16.21 MB

UnitySpec: Specification for Unity, a BDD approach

License: MIT License

C# 99.79% Gherkin 0.21%

unityspec's Introduction

UnitySpec

UnitySpec is a BDD solution for Unity3D. It is based on the Gherkin specification language. This project is based on the code from SpecFlow.

UnitySpec has been tested in Unity 2022.3 for both .Net Standard 2.1 and .Net Framework

This project uses UnitySpec.General v0.1.0 and UnitySpec.Generator v0.2.0.

Installation

  • Recommended installation through the Unity Package Manager
    • Open Unity Package Manager
    • Go to + -> Add package from git URL.. and enter https://github.com/UnitySpec/UnitySpec.git

UnitySpec requires the Unity Test Framework to run tests

Setup

  1. Create a test folder in Unity.

This can either be a EditMode or PlayMode testfolder, see the documentation from the Unity Test Framework for more information on test folders.

  1. Open the assembly definition of the test folder:
    1. Add UnitySpec.Runner.editor to the Assembly Definition References.
    2. Add BoDi.dll to the Assembe References.
    3. Press Apply.
  2. Optional: Create folders for feature files and step definition files inside the test folder.
  3. Open Settings and navigate to UnitySpec, set the folder containing the feature files under Specification folders.

You can add multiple paths for multiple folders. You can also edit the search behaviour, default is searching the listed directories and all their subdirectories.

Usage

  1. Write scenarios After installation feature files can be added in Unity by right-clicking in the project window > Create > New Feature. Scenarios should be written in Gherkin, a Gherkin reference can be found here.

  2. Create test files Once the scenario is written UnitySpec can be used to autogenerate test files to test this scenario. Go to Window > UnitySpec to open the UnitySpec Window. Click on the button to generate test files. The files are generated at the same location as the feature files.

  3. Write step definitions For each step used in the scenarios, a step definition has to be written. See the documentation on step definitions for more information.

  4. Run test files Open the test runner. For each feature file a test file should be visible, and for each scenario a test in that file. Double click a test to run it, or press the play button to run all.

    If you see no tests you might need to refresh. Do this by going to the project window and pressing ctrl + R, alternatively, right-click > Refresh, or clicking outside Unity and going back.

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.