Exemple #1
0
        public void Resolve_should_return_empty_collection_when_no_saga_registered_for_message()
        {
            var typeResolver = NSubstitute.Substitute.For <ITypeResolver>();
            var sut          = new SagaTypeResolver(typeResolver);
            var result       = sut.Resolve <StartDummySaga>();

            result.Should().NotBeNull().And.BeEmpty();
        }
Exemple #2
0
        public void Resolve_should_return_registered_saga()
        {
            var typeResolver = NSubstitute.Substitute.For <ITypeResolver>();
            var sut          = new SagaTypeResolver(typeResolver);

            sut.Register <DummySaga, DummySagaState>();

            var result = sut.Resolve <StartDummySaga>();

            result.Should().NotBeNull().And.HaveCount(1);

            result.First().sagaType.Should().Be(typeof(DummySaga));
            result.First().sagaStateType.Should().Be(typeof(DummySagaState));
        }