diff --git a/CHANGELOG.md b/CHANGELOG.md index 90a30ac..97f9077 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [1.4.2] / 2024-09-11 ### Features -- Support tests with `TestCaseSource`. +- Support tests with `TestCaseSource`. (Fix: #55) ### Application -- Update `ricaun.NUnit` to `1.4.0`. +- Update `ricaun.NUnit` to `1.4.0-beta`. ### Tests - Add `TestsCaseSource` to test `TestCaseSourceAttribute`. +- Add tests with `TestCaseData` class. ## [1.4.1] / 2024-09-06 ### TestAdapter diff --git a/Directory.Build.props b/Directory.Build.props index eab45ef..f466cf0 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,5 +1,5 @@ - 1.4.2-alpha + 1.4.2-beta \ No newline at end of file diff --git a/ricaun.RevitTest.Console/Resources/ricaun.RevitTest.Application.bundle.zip b/ricaun.RevitTest.Console/Resources/ricaun.RevitTest.Application.bundle.zip index b974f68..54b671e 100644 Binary files a/ricaun.RevitTest.Console/Resources/ricaun.RevitTest.Application.bundle.zip and b/ricaun.RevitTest.Console/Resources/ricaun.RevitTest.Application.bundle.zip differ diff --git a/ricaun.RevitTest.TestAdapter/Resources/net48/ricaun.RevitTest.Console.zip b/ricaun.RevitTest.TestAdapter/Resources/net48/ricaun.RevitTest.Console.zip index 1699193..3ccb54a 100644 Binary files a/ricaun.RevitTest.TestAdapter/Resources/net48/ricaun.RevitTest.Console.zip and b/ricaun.RevitTest.TestAdapter/Resources/net48/ricaun.RevitTest.Console.zip differ diff --git a/ricaun.RevitTest.TestAdapter/Resources/net8.0-windows/ricaun.RevitTest.Console.zip b/ricaun.RevitTest.TestAdapter/Resources/net8.0-windows/ricaun.RevitTest.Console.zip index 0ef6504..632b855 100644 Binary files a/ricaun.RevitTest.TestAdapter/Resources/net8.0-windows/ricaun.RevitTest.Console.zip and b/ricaun.RevitTest.TestAdapter/Resources/net8.0-windows/ricaun.RevitTest.Console.zip differ diff --git a/ricaun.RevitTest.Tests/TestsCaseSource.cs b/ricaun.RevitTest.Tests/TestsCaseSource.cs index 7864749..abf9b94 100644 --- a/ricaun.RevitTest.Tests/TestsCaseSource.cs +++ b/ricaun.RevitTest.Tests/TestsCaseSource.cs @@ -1,4 +1,5 @@ using NUnit.Framework; +using System.Collections; using System.Collections.Generic; namespace ricaun.RevitTest.Tests @@ -12,7 +13,6 @@ public void CasesSourceTest(int i) Assert.True(i > 0); } - static IEnumerable CasesSourceMethod() { yield return 1; @@ -32,13 +32,21 @@ static IEnumerable CasesSourceMethodWithParameters(int start, int count) yield return start + i; } } - [TestCaseSource(nameof(CasesSourceMethodWithParameters), new object[] { 1, 4 })] public void CasesSourceMethodWithParametersTest(int i) { Assert.True(i > 0); } + public class AnotherClass + { + public static object[] CasesSource = + { + new object[] { 1, 2, 3 }, + new object[] { 2, 3, 4 }, + new object[] { 3, 4, 5 } + }; + } [TestCaseSource(typeof(AnotherClass), nameof(AnotherClass.CasesSource))] public void CasesSourceAnotherClassTest(int i, int j, int k) { @@ -46,14 +54,21 @@ public void CasesSourceAnotherClassTest(int i, int j, int k) Assert.True(j > 0); Assert.True(k > 0); } - public class AnotherClass + + public static IEnumerable TestCaseDatas { - public static object[] CasesSource = + get { - new object[] { 1, 2, 3 }, - new object[] { 2, 3, 4 }, - new object[] { 3, 4, 5 } - }; + yield return new TestCaseData(0).Returns(false); + yield return new TestCaseData(1).Returns(true); + yield return new TestCaseData(2).Returns(true); + yield return new TestCaseData(3).Returns(true); + } + } + [TestCaseSource(nameof(TestCaseDatas))] + public bool CasesSourceTestCaseDataTest(int i) + { + return i > 0; } } }