Esempio n. 1
0
        public void ThrowIfQueryProcessorNotRegistered(Query query)
        {
            var emitter = new DependencyCollection()
                          .AddEmitter()
                          .BuildProvider()
                          .GetRequired <IEmitter>();

            emitter.Awaiting(e => e.Ask(query, CancellationToken))
            .Should().Throw <KeyNotFoundException>();

            emitter.Awaiting(e => e.Ask <Query, Boo>(query, CancellationToken))
            .Should().Throw <KeyNotFoundException>();
        }
Esempio n. 2
0
        public void ThrowIfCommandProcessorNotRegistered(Command command)
        {
            var emitter = new DependencyCollection()
                          .AddEmitter()
                          .BuildProvider()
                          .GetRequired <IEmitter>();

            emitter.Awaiting(e => e.Execute(command, CancellationToken))
            .Should().Throw <KeyNotFoundException>();

            emitter.Awaiting(e => e.Send(command, CancellationToken))
            .Should().Throw <KeyNotFoundException>();
        }