public void GivenATypedCollectionAndAnUnexistingId_ConcurrencyUpdateThrows_MongoConcurrencyDeletedException() { var initialObject = GetInitialObject(); Executing.This(() => TypedCollection.Optimistic().Update(initialObject)) .Should().Throw <MongoConcurrencyDeletedException>(); }
public void GivenATntypedCollectionAndAnInvalidVersion_TheObjectCanBeDeleted() { var initialObject = SaveInitialObject(UnTypedCollection); initialObject.Version = 32; Executing.This(() => TypedCollection.Optimistic().Remove(initialObject)) .Should().Throw <MongoConcurrencyUpdatedException>(); }
public void GivenATntypedCollectionAndAnInvalidVersion_ConcurrencyUpdateThrows_MongoConcurrencyUpdatedException() { var initialObject = SaveInitialObject(TypedCollection); initialObject.Age = 30; initialObject.Version = 8; Executing.This(() => TypedCollection.Optimistic().Update(initialObject)) .Should().Throw <MongoConcurrencyUpdatedException>(); }