Created
April 8, 2017 01:21
-
-
Save gyuwon/e641c868e66c480db0dfb621f2907cb6 to your computer and use it in GitHub Desktop.
CombineLatest 테스트 케이스
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
using System; | |
using System.Reactive.Linq; | |
using System.Reactive.Subjects; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace RxUnitTest | |
{ | |
[TestClass] | |
public class CombineLatestTest | |
{ | |
[TestMethod] | |
public void CombineLatest_works_correctly() | |
{ | |
// Arrange | |
var streamA = new BehaviorSubject<int>(3); | |
var streamB = new Subject<int>(); | |
IObservable<int> combined = streamA.CombineLatest(streamB, (a, b) => a + b); | |
// Act | |
int actual = default(int); | |
combined.Subscribe(x => actual = x); | |
streamB.OnNext(4); | |
// Assert | |
Assert.AreEqual(7, actual); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment