예제 #1
0
        public void CheckForMissingSharedTableDataEntries_FindsMissingEntries()
        {
            var missingEntries = CreateMissingEntries();

            // Copy the ids as they are changed if the item is removed from the table.
            var missingEntryIds = missingEntries.Select(e => e.KeyId).ToArray();

            var foundEntries = m_Table.CheckForMissingSharedTableDataEntries(MissingEntryAction.Nothing);

            Assert.AreEqual(missingEntries.Length, foundEntries.Count);
            for (int i = 0; i < foundEntries.Count; ++i)
            {
                Assert.Contains(foundEntries[i], missingEntries);
                Assert.AreEqual(missingEntryIds[i], missingEntries[i].KeyId, "Expected entry Id value to not change.");
                Assert.IsFalse(m_SharedTableData.Contains(missingEntryIds[i]), "Expected missing entry to not be added to shared table data when MissingEntryAction.Nothing is used.");
                Assert.IsTrue(m_Table.ContainsKey(missingEntryIds[i]), "Expected missing entry to still be part of table when MissingEntryAction.Nothing is used.");
            }
        }
예제 #2
0
 public void AddAndVerifyKeyIsAdded(string keyName)
 {
     Assert.IsFalse(m_SharedTableData.Contains(keyName), "Expected the key to not already be in the shared table data.");
     Assert.IsNotNull(m_SharedTableData.AddKey(keyName), "Expected the key to added however it was not.");
     Assert.IsTrue(m_SharedTableData.Contains(keyName), "Expected the key to be contained in the  shared table data.");
 }