-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from ricaun-io/develop
Version 1.5.0 - Support `TestCaseSource`.
- Loading branch information
Showing
6 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<Version>1.4.1</Version> | ||
<Version>1.5.0</Version> | ||
</PropertyGroup> | ||
</Project> |
Binary file modified
BIN
+5.62 KB
(100%)
ricaun.RevitTest.Console/Resources/ricaun.RevitTest.Application.bundle.zip
Binary file not shown.
Binary file modified
BIN
+6.49 KB
(100%)
ricaun.RevitTest.TestAdapter/Resources/net48/ricaun.RevitTest.Console.zip
Binary file not shown.
Binary file modified
BIN
+7 KB
(100%)
ricaun.RevitTest.TestAdapter/Resources/net8.0-windows/ricaun.RevitTest.Console.zip
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<int> CasesSourceMethod() | ||
{ | ||
yield return 1; | ||
yield return 2; | ||
yield return 3; | ||
} | ||
[TestCaseSource(nameof(CasesSourceMethod))] | ||
public void CasesSourceMethodTest(int i) | ||
{ | ||
Assert.True(i > 0); | ||
} | ||
|
||
static IEnumerable<int> 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; | ||
} | ||
} | ||
} |