Exemple #1
0
 public void ContentHashListWithDeterminismRoundTrip(int contentHashCount, int determinism)
 {
     ContentHashListWithDeterminism contentHashListWithDeterminism = new ContentHashListWithDeterminism(
         ContentHashList.Random(HashingType, contentHashCount),
         m_memoizationDeterminism[determinism]);
     ContentHashListWithDeterminism roundTrip = contentHashListWithDeterminism.FromMemoization().ToMemoization();
 }
Exemple #2
0
        public void ContentHashListWithDeterminismFromMemoization(int contentHashCount, int determinism)
        {
            ContentHashListWithDeterminism contentHashListWithDeterminism = new ContentHashListWithDeterminism(
                ContentHashList.Random(HashingType, contentHashCount),
                m_memoizationDeterminism[determinism]);
            CasEntries casEntries = contentHashListWithDeterminism.FromMemoization();

            Assert.Equal(contentHashListWithDeterminism.ContentHashList.Hashes.Count, casEntries.Count);
            for (int i = 0; i < casEntries.Count; i++)
            {
                Assert.Equal(contentHashListWithDeterminism.ContentHashList.Hashes[i], casEntries[i].ToMemoization());
            }

            AssertDeterminismEqualEnough(casEntries.Determinism, contentHashListWithDeterminism.Determinism);
        }