예제 #1
0
        public void GhostKey_dissapear_after_something()
        {
            var dictionary = new Dictionary <GhostKey, int>();
            var key        = new GhostKey("Белая дама");

            dictionary.Add(key, 42);

            key.DoSomething();

            Assert.IsFalse(dictionary.ContainsKey(key));
        }
예제 #2
0
        public void GhostKey_dissapear_after_something()
        {
            var key1 = new GhostKey("Белая дама");
            var set  = new HashSet <GhostKey> {
                key1
            };

            key1.DoSomething();

            Assert.IsFalse(set.Contains(key1));
            Assert.AreEqual(1, set.Count);
            Assert.AreEqual("Белая дама", key1.Name);
        }