Exemplo n.º 1
0
    public void NoHandlerTest()
    {
        ICDictionary <string, string> dictionary = new ICDictionary <string, string>();

        Assert.IsFalse(dictionary.ContainsKey("Key"));
        dictionary.Add("Key", "Value");
        Assert.IsTrue(dictionary.ContainsKey("Key"));
        dictionary.Remove("Key");
        Assert.IsFalse(dictionary.ContainsKey("Key"));
    }
Exemplo n.º 2
0
    public void InsertTest()
    {
        AutoResetEvent ev = new AutoResetEvent(false);

        ICDictionary <string, string> dictionary = new ICDictionary <string, string>();

        dictionary.OnChanged.AddListener(() => { ev.Set(); });

        dictionary.Add("Key", "Value");
        Assert.IsTrue(ev.WaitOne(100));
        Assert.IsTrue(dictionary.ContainsKey("Key") && dictionary["Key"] == "Value");
    }