-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into 'master'
Develop See merge request company-projects/Meadow!32
- Loading branch information
Showing
13 changed files
with
215 additions
and
84 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Meadow.UnitTestTemplate.Test | ||
{ | ||
|
||
[MeadowTestClass] | ||
public class CustomTestDescriptionWithMeadowTestClassAttribute : ContractTest | ||
{ | ||
[TestMethod] | ||
[Description("Custom example description")] | ||
public async Task ExampleTestWithDescription() | ||
{ | ||
await Task.CompletedTask; | ||
} | ||
|
||
[TestMethod] | ||
[System.ComponentModel.Description("Custom example description")] | ||
public async Task ExampleTestWithDescription2() | ||
{ | ||
await Task.CompletedTask; | ||
} | ||
|
||
[DataTestMethod] | ||
[Description("thing {0} and thing {1}")] | ||
[DataRow("some val 1", 32465)] | ||
[DataRow("next valll", 1111)] | ||
public async Task ExampleDataDrivenTest(string val1, int num2) | ||
{ | ||
await Task.CompletedTask; | ||
} | ||
} | ||
|
||
[TestClass] | ||
public class CustomTestDescriptionWithMeadowTestMethodAttributes : ContractTest | ||
{ | ||
[MeadowTestMethod] | ||
[Description("Custom example description")] | ||
public async Task ExampleTestWithDescription() | ||
{ | ||
await Task.CompletedTask; | ||
} | ||
|
||
[MeadowDataTestMethod] | ||
[Description("thing {0} and thing {1}")] | ||
[DataRow("some val 1", 32465)] | ||
[DataRow("next valll", 1111)] | ||
public async Task ExampleDataDrivenTest(string val1, int num2) | ||
{ | ||
await Task.CompletedTask; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using ExposedObject; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace Meadow.UnitTestTemplate | ||
{ | ||
static class ITestMethodExtensions | ||
{ | ||
public static TestContext GetTestContext(this ITestMethod testMethod) | ||
{ | ||
// Obtain our test method options | ||
var testMethodOptions = Exposed.From(testMethod).TestMethodOptions; | ||
|
||
// Obtain our test context. | ||
var testContext = Exposed.From(testMethodOptions).TestContext as TestContext; | ||
|
||
// Return the test context | ||
return testContext; | ||
} | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace Meadow.UnitTestTemplate | ||
{ | ||
public class MeadowTestClassAttribute : TestClassAttribute | ||
{ | ||
public override TestMethodAttribute GetTestMethodAttribute(TestMethodAttribute testMethodAttribute) | ||
{ | ||
return new MeadowTestMethodAttribute(); | ||
} | ||
|
||
public override bool IsDefaultAttribute() | ||
{ | ||
return base.IsDefaultAttribute(); | ||
} | ||
} | ||
} |
Oops, something went wrong.