public void DoesntPairValuesFromSameStream()
            {
                var left = new[] { 1, 1 };
                var right = new[] { 2, 2 };

                var results = left.ToObservable().MatchPair(right.ToObservable(), x => x).ToEnumerable().ToList();

                Assert.Empty(results);
            }
            public void IgnoresSingleValuesAfterCompletion()
            {
                var left = new[] { 1, 2, 1 };
                var right = new[] { 2, 1, 2 };
                var expected = new HashSet<Pair<int>>(Enumerable.Range(1, 2).Select(x => new Pair<int>(x, x)));

                var results = left.ToObservable().MatchPair(right.ToObservable(), x => x).ToEnumerable().ToList();

                Assert.True(expected.SetEquals(results));
            }
Exemplo n.º 3
0
 public void a_sequence_of_items_converted_to_an_obserable_should_yield_the_same_values()
 {
     var items = new[] {1,2,3};
     var observable = items.ToObservable();
     var observed = new List<int>();
     var subscription = observable.Subscribe(observed.Add);
     subscription.Dispose();
     Assert.AreEqual(items.Length, observed.Count);
     for (int i = 0; i < items.Length; i++)
         Assert.AreEqual(items[i], observed[i]);
 }