public void FlatMapValues_ReturnsNewKStream() { var observable = Observable.Return(DEFAULT_KEY_VALUE_PAIR); var testObject = new KStream <Unit, Unit>(observable); var actual = testObject.FlatMapValues(x => new[] { x }); Assert.NotSame(testObject, actual); }
public async void FlatMapValues_AppliesProcessorToStream() { var observable = Observable.Return(KeyValuePair.Create(Unit.Default, "3")); var testObject = new KStream <Unit, string>(observable); var expected = new[] { KeyValuePair.Create(Unit.Default, 1), KeyValuePair.Create(Unit.Default, 2), KeyValuePair.Create(Unit.Default, 3) }; var actual = await testObject .FlatMapValues(x => Enumerable.Range(1, int.Parse(x))) .ToObservable() .ToList().SingleAsync(); Assert.Equal(expected, actual); }