-
Notifications
You must be signed in to change notification settings - Fork 691
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: move test classes to individual files
- Loading branch information
1 parent
5e7baef
commit 99c39e3
Showing
3 changed files
with
65 additions
and
53 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/Uno.UI.RuntimeTests/Tests/UnitTestsTests/Give_UnitTest_DynamicData_From_Method.cs
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,31 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace Uno.UI.RuntimeTests.Tests.UnitTestsTests | ||
{ | ||
[TestClass] | ||
class Give_UnitTest_DynamicData_From_Method : IDisposable | ||
{ | ||
static int TestSucces_Count = 0; | ||
|
||
[DataTestMethod] | ||
[DynamicData(nameof(GetData), DynamicDataSourceType.Method)] | ||
public void When_Get_Arguments_From_Method(int a, int b, int expected) | ||
{ | ||
var actual = a + b; | ||
Assert.AreEqual(expected, actual); | ||
TestSucces_Count++; | ||
} | ||
|
||
public static IEnumerable<object[]> GetData() | ||
{ | ||
yield return new object[] { 1, 1, 2 }; | ||
yield return new object[] { 12, 30, 42 }; | ||
yield return new object[] { 14, 1, 15 }; | ||
} | ||
|
||
public void Dispose() => | ||
Assert.Equals(TestSucces_Count, 3); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/Uno.UI.RuntimeTests/Tests/UnitTestsTests/Give_UnitTest_DynamicData_From_Property.cs
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,34 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace Uno.UI.RuntimeTests.Tests.UnitTestsTests | ||
{ | ||
[TestClass] | ||
class Give_UnitTest_DynamicData_From_Property : IDisposable | ||
{ | ||
static int TestSucces_Count = 0; | ||
|
||
[DataTestMethod] | ||
[DynamicData(nameof(Data), DynamicDataSourceType.Property)] | ||
public void When_Get_Arguments_From_Property(int a, int b, int expected) | ||
{ | ||
var actual = a + b; | ||
Assert.AreEqual(expected, actual); | ||
TestSucces_Count++; | ||
} | ||
|
||
public static IEnumerable<object[]> Data | ||
{ | ||
get | ||
{ | ||
yield return new object[] { 1, 1, 2 }; | ||
yield return new object[] { 12, 30, 42 }; | ||
yield return new object[] { 14, 1, 15 }; | ||
} | ||
} | ||
|
||
public void Dispose() => | ||
Assert.Equals(TestSucces_Count, 3); | ||
} | ||
} |
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