Skip to content

Instantly share code, notes, and snippets.

@rimever
Last active October 9, 2018 14:01
Show Gist options
  • Save rimever/c23a973ab3bc18c74d93bbbd917d016a to your computer and use it in GitHub Desktop.
Save rimever/c23a973ab3bc18c74d93bbbd917d016a to your computer and use it in GitHub Desktop.
NUnitのCategoryを用いて、特定のテストコードをCIに実行させない ref: https://qiita.com/rim_0720/items/294d71dddd2935614b31
/// <summary>
/// <see cref="BaseGameInfo.SaveDataBase"/>をテストします。
/// </summary>
/// <remarks>
/// TeamCityだと失敗するので、Category属性を付与
/// </remarks>
[Category("BuildServerIgnore")]
[Test]
public void SaveDatabase()
{
// 何かしらの DB処理
}
public class TestSetup
{
public const string BuildServerIgnoreCategory = "BuildServerIgnore";
}
[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