public void Test_TryGetValue_DoesNotExist() { const string key = "CouchbaseDictionaryTests.Test_TryGetValue_DoesNotExist"; _bucket.Remove(key); var dictionary = new CouchbaseDictionary <string, Poco>(_bucket, key); dictionary.Add("somekey2", new Poco { Name = "poco2" }); Poco item; var result = dictionary.TryGetValue("somekey3", out item); Assert.IsFalse(result); Assert.IsNull(item); }
public void Test_TryGetValue() { const string key = "CouchbaseDictionaryTests.Test_TryGetValue"; _bucket.Remove(key); var dictionary = new CouchbaseDictionary <string, Poco>(_bucket, key); dictionary.Add("somekey2", new Poco { Name = "poco2" }); Poco item; var result = dictionary.TryGetValue("somekey2", out item); Assert.IsTrue(result); Assert.AreEqual("poco2", item.Name); }
public void Test_TryGetValue_DoesNotExist() { const string key = "CouchbaseDictionaryTests.Test_TryGetValue_DoesNotExist"; _bucket.Remove(key); var dictionary = new CouchbaseDictionary<string, Poco>(_bucket, key); dictionary.Add("somekey2", new Poco { Name = "poco2" }); Poco item; var result = dictionary.TryGetValue("somekey3", out item); Assert.IsFalse(result); Assert.IsNull(item); }
public void Test_TryGetValue() { const string key = "CouchbaseDictionaryTests.Test_TryGetValue"; _bucket.Remove(key); var dictionary = new CouchbaseDictionary<string, Poco>(_bucket, key); dictionary.Add("somekey2", new Poco { Name = "poco2" }); Poco item; var result = dictionary.TryGetValue("somekey2", out item); Assert.IsTrue(result); Assert.AreEqual("poco2", item.Name); }