Esempio n. 1
0
        async Task ThrowConflictResolverThrowsOnConflict()
        {
            var sut = new ThrowConflictResolver();

            var e = await Record.ExceptionAsync(() =>
                                                sut.Resolve <FakeEntity, FakeState>(Fake <FakeEntity>(), Fake <Guid>(), Fake <Dictionary <string, string> >()))
                    .ConfigureAwait(false);

            e.Should().BeOfType <ConflictResolutionFailedException>();
        }
        public void throw_resolver()
        {
            // Does not resolve, just throws
            var resolver = new ThrowConflictResolver();

            var fullevent = new Moq.Mock <IFullEvent>();

            fullevent.Setup(x => x.Event).Returns(new Event());

            var entity = new Entity(_stream.Object, _resolver.Object);

            Assert.ThrowsAsync <ConflictResolutionFailedException>(
                () => resolver.Resolve(entity, new[] { fullevent.Object }, Guid.NewGuid(), new Dictionary <string, string>()));
        }