public void Test_SimpleLookupList_Int_String_GetKey_Exists()
        {
            //---------------Set up test pack-------------------
            PropDef propDef = new PropDef("PropName", typeof(int), PropReadWriteRule.ReadWrite, null);
            const int validInt = 1;
            Dictionary<string, string> collection_int = new Dictionary<string, string>
                                                            {{_validLookupValue, validInt.ToString()}};

            SimpleLookupList simpleLookupList = new SimpleLookupList(collection_int);
            propDef.LookupList = simpleLookupList;
            Dictionary<string, string> list = simpleLookupList.GetLookupList();
            //---------------Assert Precondition----------------
            Assert.IsInstanceOf(typeof(SimpleLookupList), propDef.LookupList);
            Assert.AreSame(propDef, simpleLookupList.PropDef);
            //---------------Execute Test ----------------------
            string returnedKey;
            bool keyReturned = list.TryGetValue(_validLookupValue, out returnedKey);
            //---------------Test Result -----------------------
            Assert.IsTrue(keyReturned);
            Assert.AreEqual(validInt.ToString(), returnedKey);
        }
 public void Test_SetLookupList_SetsUpKeyLookupList()
 {
     //---------------Set up test pack-------------------
     PropDef propDef = new PropDef("PropName", typeof(Guid), PropReadWriteRule.ReadWrite, null);
     SimpleLookupList simpleLookupList = new SimpleLookupList(_collection);
     //---------------Assert Precondition----------------
     Assert.IsInstanceOf(typeof(NullLookupList), propDef.LookupList);
     Assert.AreEqual(_collection.Count, simpleLookupList.GetLookupList().Count);
     //---------------Execute Test ----------------------
     propDef.LookupList = simpleLookupList;
     //---------------Test Result -----------------------
     Assert.IsInstanceOf(typeof(SimpleLookupList), propDef.LookupList);
     Assert.AreSame(propDef, simpleLookupList.PropDef);
     Assert.AreEqual(_collection.Count, simpleLookupList.GetLookupList().Count);
     Assert.AreEqual(_collection.Count, simpleLookupList.GetIDValueLookupList().Count);
 }
 public void Test_SimpleLookupList_GetKey_NotExists()
 {
     //---------------Set up test pack-------------------
     PropDef propDef = new PropDef("PropName", typeof(Guid), PropReadWriteRule.ReadWrite, null);
     SimpleLookupList simpleLookupList = new SimpleLookupList(_collection);
     propDef.LookupList = simpleLookupList;
     Dictionary<string, string> list = simpleLookupList.GetLookupList();
     //---------------Assert Precondition----------------
     Assert.IsInstanceOf(typeof(SimpleLookupList), propDef.LookupList);
     Assert.AreSame(propDef, simpleLookupList.PropDef);
     //---------------Execute Test ----------------------
     string returnedKey;
     bool keyReturned = list.TryGetValue("InvalidValue", out returnedKey);
     //---------------Test Result -----------------------
     Assert.IsFalse(keyReturned);
     Assert.IsNull(returnedKey);
 }
 public void Test_SimpleLookup_Create_SetsUpKeyLookupList()
 {
     //---------------Set up test pack-------------------
     PropDef propDef = new PropDef("PropName", typeof(Guid), PropReadWriteRule.ReadWrite, null);
     //---------------Assert Precondition----------------
     Assert.AreEqual(2, _collection.Count);
     //---------------Execute Test ----------------------
     SimpleLookupList simpleLookupList = new SimpleLookupList(_collection);
     simpleLookupList.PropDef = propDef;
     //---------------Assert Precondition----------------
     Assert.AreEqual(_collection.Count, simpleLookupList.GetLookupList().Count);
     Assert.IsNotNull(simpleLookupList.GetIDValueLookupList());
     Assert.AreEqual(2, simpleLookupList.GetIDValueLookupList().Count);
 }