Beispiel #1
0
        public void GivenATypedCollectionAndAnUnexistingId_ConcurrencyUpdateThrows_MongoConcurrencyDeletedException()
        {
            var initialObject = GetInitialObject();

            Executing.This(() => TypedCollection.Optimistic().Update(initialObject))
            .Should().Throw <MongoConcurrencyDeletedException>();
        }
Beispiel #2
0
        public void GivenATntypedCollectionAndAnInvalidVersion_TheObjectCanBeDeleted()
        {
            var initialObject = SaveInitialObject(UnTypedCollection);

            initialObject.Version = 32;

            Executing.This(() => TypedCollection.Optimistic().Remove(initialObject))
            .Should().Throw <MongoConcurrencyUpdatedException>();
        }
Beispiel #3
0
        public void GivenATntypedCollectionAndAnInvalidVersion_ConcurrencyUpdateThrows_MongoConcurrencyUpdatedException()
        {
            var initialObject = SaveInitialObject(TypedCollection);

            initialObject.Age     = 30;
            initialObject.Version = 8;

            Executing.This(() => TypedCollection.Optimistic().Update(initialObject))
            .Should().Throw <MongoConcurrencyUpdatedException>();
        }