diff --git a/CHANGELOG.md b/CHANGELOG.md index c7ed953..18ff770 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [1.5.0] / 2024-09-11 - 2024-09-19 +### Features +- Support tests with `TestCaseSource`. (Fix: #55) +### Application +- Update `ricaun.NUnit` to `1.4.0`. +### Tests +- Add `TestsCaseSource` to test `TestCaseSourceAttribute`. +- Add tests with `TestCaseData` class with expected result. + ## [1.4.1] / 2024-09-06 ### TestAdapter - Update project reference to `PrivateAssets` to remove reference in the package. @@ -477,6 +486,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - [x] TestsFail [vNext]: ../../compare/1.0.0...HEAD +[1.5.0]: ../../compare/1.4.1...1.5.0 [1.4.1]: ../../compare/1.4.0...1.4.1 [1.4.0]: ../../compare/1.3.6...1.4.0 [1.3.6]: ../../compare/1.3.5...1.3.6 diff --git a/Directory.Build.props b/Directory.Build.props index a5caae5..019c277 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,5 +1,5 @@ - 1.4.1 + 1.5.0 \ 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 f4f1e60..b5e8079 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 537481f..55793f3 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 917ba99..52c6a11 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 new file mode 100644 index 0000000..abf9b94 --- /dev/null +++ b/ricaun.RevitTest.Tests/TestsCaseSource.cs @@ -0,0 +1,74 @@ +using NUnit.Framework; +using System.Collections; +using System.Collections.Generic; + +namespace ricaun.RevitTest.Tests +{ + public class TestsCaseSource + { + public static int[] CasesSource = new[] { 1, 2, 3 }; + [TestCaseSource(nameof(CasesSource))] + public void CasesSourceTest(int i) + { + Assert.True(i > 0); + } + + static IEnumerable CasesSourceMethod() + { + yield return 1; + yield return 2; + yield return 3; + } + [TestCaseSource(nameof(CasesSourceMethod))] + public void CasesSourceMethodTest(int i) + { + Assert.True(i > 0); + } + + static IEnumerable CasesSourceMethodWithParameters(int start, int count) + { + for (int i = 0; i < count; i++) + { + 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) + { + Assert.True(i > 0); + Assert.True(j > 0); + Assert.True(k > 0); + } + + public static IEnumerable TestCaseDatas + { + get + { + 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; + } + } +}