Exemplo n.º 1
0
 public ChecksumObjectCollection(SerializationValidator validator, ChecksumCollection collection)
     : base(collection.Checksum, collection.GetWellKnownSynchronizationKind())
 {
     // using .Result here since we don't want to convert all calls to this to async.
     // and none of ChecksumWithChildren actually use async
     Children = ImmutableArray.CreateRange(collection.Select(c => validator.GetValueAsync <T>(c).Result));
 }
        internal static void VerifyCollectionInService(IRemotableDataService snapshotService, ChecksumCollection checksums, int expectedCount, WellKnownSynchronizationKind expectedItemKind)
        {
            VerifyChecksumInService(snapshotService, checksums.Checksum, checksums.GetWellKnownSynchronizationKind());
            Assert.Equal(checksums.Count, expectedCount);

            foreach (var checksum in checksums)
            {
                VerifyChecksumInService(snapshotService, checksum, expectedItemKind);
            }
        }
        internal static async Task VerifyCollectionInService(IRemotableDataService snapshotService, ChecksumCollection checksums, int expectedCount, WellKnownSynchronizationKind expectedItemKind)
        {
            await VerifyChecksumInServiceAsync(snapshotService, checksums.Checksum, checksums.GetWellKnownSynchronizationKind()).ConfigureAwait(false);

            Assert.Equal(checksums.Count, expectedCount);

            foreach (var checksum in checksums)
            {
                await VerifyChecksumInServiceAsync(snapshotService, checksum, expectedItemKind).ConfigureAwait(false);
            }
        }