public async Task when_collectionstorage_asarray_and_with_readonlycollection_with_integers_and_private_setter() { var cancellation = new CancellationTokenSource(); cancellation.CancelAfter(1.Minutes()); // CancellationToken var token = cancellation.Token; StoreOptions(_ => { _.UseDefaultSerialization(collectionStorage: CollectionStorage.AsArray); }); var user = new UserWithReadonlyCollectionWithPrivateSetter(Guid.NewGuid(), "James", new[] { 1, 2, 3 }); theSession.Store(user); await theSession.SaveChangesAsync(token); var userFromDb = await theSession.LoadAsync <UserWithReadonlyCollectionWithPrivateSetter>(user.Id, token); userFromDb.Id.ShouldBe(user.Id); userFromDb.Name.ShouldBe(user.Name); userFromDb.Collection.ShouldHaveTheSameElementsAs(user.Collection); }
public void when_collectionstorage_asarray_and_with_readonlycollection_with_integers_and_private_setter() { StoreOptions(_ => { _.UseDefaultSerialization(collectionStorage: CollectionStorage.AsArray); }); var user = new UserWithReadonlyCollectionWithPrivateSetter(Guid.NewGuid(), "James", new[] { 1, 2, 3 }); theSession.Store(user); theSession.SaveChanges(); var userFromDb = theSession.Load <UserWithReadonlyCollectionWithPrivateSetter>(user.Id); userFromDb.Id.ShouldBe(user.Id); userFromDb.Name.ShouldBe(user.Name); userFromDb.Collection.ShouldHaveTheSameElementsAs(user.Collection); }