-
Notifications
You must be signed in to change notification settings - Fork 750
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 #1115 from akarnokd/TestSchedulerParamValidationFix
Add more argument validation to TestScheduler.Start
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 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
29 changes: 29 additions & 0 deletions
29
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/TestSchedulerTest.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,29 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the Apache 2.0 License. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Reactive.Concurrency; | ||
using System.Reactive.Linq; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.Reactive.Testing; | ||
using Xunit; | ||
|
||
namespace ReactiveTests.Tests | ||
{ | ||
|
||
public class TestSchedulerTest | ||
{ | ||
[Fact] | ||
public void Test_ArgumentChecking() | ||
{ | ||
ReactiveAssert.Throws<ArgumentNullException>(() => new TestScheduler().Start<int>(null)); | ||
ReactiveAssert.Throws<ArgumentNullException>(() => new TestScheduler().Start<int>(null, 10)); | ||
ReactiveAssert.Throws<ArgumentOutOfRangeException>(() => new TestScheduler().Start(() => Observable.Empty<int>(), 10)); | ||
ReactiveAssert.Throws<ArgumentOutOfRangeException>(() => new TestScheduler().Start(() => Observable.Empty<int>(), 10, 15, 5)); | ||
} | ||
} | ||
} |