Example #1
0
        public void Should_set_expected_of_flush_test_when_to_be_is_called()
        {
            var valueComparer = Comparer <char> .Create((a, b) => 0);

            var errorComparer = Comparer <Exception> .Create((a, b) => 0);

            var values = new { a = 'a' };
            var error  = new Exception("error!");

            var notifications = new[] { new Recorded <Notification <char> >(0, Notification.CreateOnNext('a')) };

            _parser.Parse <char>("a|", values, error, 10).Returns(notifications);
            _assertFactory.CreateForObservable(valueComparer, errorComparer).Returns((a, b) => { });

            var sut = new ExpectableObservable <char>(_flushable, 10, _parser, _assertFactory);

            sut.ToBe("a|", values, error, valueComparer, errorComparer);
            Assert.That(_flushable.Expected, Is.EquivalentTo(notifications));
        }
Example #2
0
 public void ToBe(string marbles, object?values = null, Exception?error = null, IComparer <T>?valueComparer = null, IComparer <Exception>?errorComparer = null)
 {
     _flushableTest.Expected       = _parser.Parse <T>(marbles, values, error, _frameTimeFactor);
     _flushableTest.AssertCallback = _assertFactory.CreateForObservable(valueComparer, errorComparer);
 }