Last active
October 9, 2018 14:01
-
-
Save rimever/c23a973ab3bc18c74d93bbbd917d016a to your computer and use it in GitHub Desktop.
NUnitのCategoryを用いて、特定のテストコードをCIに実行させない ref: https://qiita.com/rim_0720/items/294d71dddd2935614b31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// <see cref="BaseGameInfo.SaveDataBase"/>をテストします。 | |
/// </summary> | |
/// <remarks> | |
/// TeamCityだと失敗するので、Category属性を付与 | |
/// </remarks> | |
[Category("BuildServerIgnore")] | |
[Test] | |
public void SaveDatabase() | |
{ | |
// 何かしらの DB処理 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestSetup | |
{ | |
public const string BuildServerIgnoreCategory = "BuildServerIgnore"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Category(TestSetup.BuildServerIgnoreCategory)] | |
[Test] | |
public void SaveDatabase() | |
{ | |
// 省略 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment