Пример #1
0
        public void WhenHandlerWithoutTokenReturnsExpectedResult()
        {
            var sut = new AnonymousConnectedProjectionBuilder <object>();

            var result = sut.When <object>((_, __) => TaskFactory());

            Assert.That(result, Is.InstanceOf <AnonymousConnectedProjectionBuilder <object> >());
        }
Пример #2
0
        public void WhenSyncHandlerReturnsExpectedResult()
        {
            var sut = new AnonymousConnectedProjectionBuilder <object>();

            var result = sut.When <object>((_, __) => { });

            Assert.That(result, Is.InstanceOf <AnonymousConnectedProjectionBuilder <object> >());
        }
Пример #3
0
        public void InitialInstanceBuildReturnsExpectedResult()
        {
            var sut = new AnonymousConnectedProjectionBuilder <object>();

            var result = sut.Build();

            Assert.That(result, Is.Empty);
        }
        public void InitialInstanceBuildReturnsExpectedResult()
        {
            var sut = new AnonymousConnectedProjectionBuilder<object>();

            var result = sut.Build();

            Assert.That(result, Is.Empty);
        }
Пример #5
0
        public void HandlersAreCopiedOnConstruction()
        {
            var handler1 = new ConnectedProjectionHandler <object>(
                typeof(object),
                (_, __, ___) => TaskFactory());
            var handler2 = new ConnectedProjectionHandler <object>(
                typeof(object),
                (_, __, ___) => TaskFactory());
            var sut = new AnonymousConnectedProjectionBuilder <object>(new[]
            {
                handler1,
                handler2
            });

            var result = sut.Build();

            Assert.That(result, Is.EquivalentTo(new[]
            {
                handler1, handler2
            }));
        }
        public void HandlersAreCopiedOnConstruction()
        {
            var handler1 = new ConnectedProjectionHandler<object>(
                typeof(object),
                (_,__,___) => TaskFactory());
            var handler2 = new ConnectedProjectionHandler<object>(
                typeof(object),
                (_, __, ___) => TaskFactory());
            var sut = new AnonymousConnectedProjectionBuilder<object>(new[]
            {
                handler1,
                handler2
            });

            var result = sut.Build();

            Assert.That(result, Is.EquivalentTo(new[]
            {
                handler1, handler2
            }));
        }
Пример #7
0
        public void WhenSyncHandlerCanNotBeNull()
        {
            var sut = new AnonymousConnectedProjectionBuilder <object>();

            Assert.Throws <ArgumentNullException>(() => sut.When((Action <object, object>)null));
        }
Пример #8
0
        public void WhenHandlerWithTokenCanNotBeNull()
        {
            var sut = new AnonymousConnectedProjectionBuilder <object>();

            Assert.Throws <ArgumentNullException>(() => sut.When((Func <object, object, CancellationToken, Task>)null));
        }
Пример #9
0
 public void SetUp()
 {
     _sut = new AnonymousConnectedProjectionBuilder <CallRecordingConnection>();
 }
 public void SetUp()
 {
     _sut = new AnonymousConnectedProjectionBuilder<CallRecordingConnection>();
 }
        public void WhenHandlerWithTokenReturnsExpectedResult()
        {
            var sut = new AnonymousConnectedProjectionBuilder<object>();

            var result = sut.When<object>((_, __, ___) => TaskFactory());

            Assert.That(result, Is.InstanceOf<AnonymousConnectedProjectionBuilder<object>>());
        }
 public void WhenHandlerWithTokenMessageCanNotBeNull()
 {
     var sut = new AnonymousConnectedProjectionBuilder<object>();
     Assert.Throws<ArgumentNullException>(() => sut.When((Func<object, object, CancellationToken, Task>)null));
 }