Пример #1
0
        public void AddProperty()
        {
            Assert.AreEqual(0, _pool.CustomProperties.Count());

            Property prop = new StringProperty("author", "Justin");

            _pool.CustomProperties.PropertyAdded += (s, e) =>
            {
                Assert.AreEqual(prop, e.Property);
            };
            _pool.CustomProperties.Add(prop);

            Assert.AreEqual(EventFlags.Modified | EventFlags.PropertyAdded, _eventsFired);
            Assert.AreEqual(1, _pool.CustomProperties.Count());
            Assert.AreEqual(PropertyCategory.Custom, _pool.LookupPropertyCategory("author"));
            Assert.AreEqual(prop, _pool.LookupProperty("author"));
        }