Skip to content

nowsprinting/UnityTestExamples

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Unity Test Examples

meta-check test Integration Test

Click English for English page if you need.

このリポジトリについて

このリポジトリは、同人誌『Unity Test Framework完全攻略ガイド』および同『統合テスト編』のサンプルコードです。

電子版 (PDF) は次のWebサイトから購入できます。

BOOTH

技術書典マーケット

サンプルプロジェクトの構造

統合テスト編のサンプルには、 Integration カテゴリーを設定しています。

APIExamples

Unity Test FrameworkおよびNUnit3のAPIカタログ

Assets
└── APIExamples
    ├── Scripts
    │   └── (snip)
    └── Tests
        ├── Editor
        │   └── UnityTestFramework
        │       └── 第3章 Edit Modeテスト, 第5章 非同期処理のテスト
        └── Runtime
            ├── NUnit
            │   └── 第6章 アサーション, 第8章 パラメタライズドテスト, 第9章 Unity Test Framework Tips
            └── UnityTestFramework
                └── 第5章 非同期処理のテスト, 第9章 Unity Test Framework Tips

BasicExample

第2章 Unity Test Frameworkの基本

Assets
└── BasicExample
    ├── Scenes
    │   └── (snip)
    ├── ScriptableObjects
    │   └── (snip)
    ├── Scripts
    │   ├── Editor
    │   │   └── (snip)
    │   └── Runtime
    │       ├── Entities
    │       │   ├── CharacterStatus.cs          // 「2.4 テストコードの書きかた」のSUT
    │       │   └── (snip)
    │       └── Level
    │           └── (snip)
    └── Tests
        ├── Editor
        │   └── AssetValidators
        │       ├── LevelValidator.cs
        │       └── RaceValidator.cs
        └── Runtime
            └── Entities
                ├── Enums
                │   └── ElementTest.cs
                ├── Settings
                │   └── HitPointGaugeSettingTest.cs // 「14.2 仕様テストにおけるテストケースの考えかた」のテストコード
                ├── CharacterStatueTest.cs      // 「2.4 テストコードの書きかた」のテストコード
                └── PassiveEffectTest.cs        // 「14.2.5 状態遷移テスト」のテストコード

TestDoubleExample

第7章 テストダブル

Assets
└── TestDoubleExample

InternalsVisibleToExample

第9章 Unity Test Framework Tips

Assets
└── InternalsVisibleToExample   // 「9.10 internalメソッドのテストを書きたい」

SceneExample

第10章 Sceneを使用するテスト

Assets
└── SceneExample

Packages

第11章 UPM パッケージのテスト

埋め込みパッケージ

Packages
└── com.nowsprinting.embedded-package-sample

ローカルパッケージ

LocalPackages
└── com.nowsprinting.local-package-sample

UGUIExample

統合テスト編 第2章 uGUI操作の自動化

Assets
└── UGUIExample

InputSystemExample

統合テスト編 第3章 Input Systemによる操作の自動化

Assets
└── InputSystemExample

InputExample

統合テスト編 第4章 Input Managerによる操作の自動化

Assets
└── InputExample

VisualRegressionExample

統合テスト編 第5章 ビジュアルリグレッションテスト

Assets
└── VisualRegressionExample

WebGL Player

以下のUnityバージョンで問題が取り除かれたため(UUM-1170)、WebGLプレイヤーでもUnityTest属性のテストを実行するようにしてあります。

Fixed in 2020.3.42f1, 2021.3.8f1, 2022.1.12f1, 2022.2.0b3, 2023.1.0a4

これらのUnityバージョン未満では、WebGLプレイヤーでPlay Modeテストを実行しようとするとコンパイルエラーとなります。

Unity Test Framework v2.0

Add examples for Unity Test Framework v2.0 #1を参照してください

License

MIT License

About

Sample project for『Unity Test Framework完全攻略ガイド』and『Unity Test Framework完全攻略ガイド 統合テスト編』

Topics

Resources

License

Stars

Watchers

Forks