-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Close stream instead of dispose and fix unit test (#3705)
* Close stream instead of dispose and fix unit test * - cleanup
- Loading branch information
Showing
4 changed files
with
67 additions
and
11 deletions.
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
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,32 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using Xunit.Sdk; | ||
|
||
namespace Microsoft.Maui.DeviceTests | ||
{ | ||
/// <summary> | ||
/// Usage Example | ||
/// [Theory] | ||
/// [Repeat(100)] | ||
/// public async Task TheSameImageSourceReturnsTheSameBitmap(int _) | ||
/// </summary> | ||
public sealed class RepeatAttribute : DataAttribute | ||
{ | ||
readonly int _count; | ||
|
||
public RepeatAttribute(int count) | ||
{ | ||
this._count = count; | ||
} | ||
|
||
public override IEnumerable<object[]> GetData(MethodInfo testMethod) | ||
{ | ||
foreach (var iterationNumber in Enumerable.Range(start: 1, count: this._count)) | ||
{ | ||
yield return new object[] { iterationNumber }; | ||
} | ||
} | ||
} | ||
} |