Пример #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"));
    }
Пример #2
0
    public void DeleteTest()
    {
        AutoResetEvent ev = new AutoResetEvent(false);

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

        dictionary.Add("Key", "Value");

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

        Assert.IsTrue(ev.WaitOne(100));
        Assert.IsFalse(dictionary.ContainsKey("Key"));
    }