Esempio n. 1
0
        public void WhenChangeElementIsCalledToChangeTypeThenTypeIsChanged()
        {
            DsmElementModel model = new DsmElementModel();

            Assert.AreEqual(1, model.GetElementCount());

            IDsmElement a = model.ImportElement(1, "a", "type", 10, true, null, false);
            IDsmElement b = model.ImportElement(2, "b", "type", 11, true, a.Id, false);

            IDsmElement foundElementBefore = model.FindElementByFullname("a.b");

            Assert.IsNotNull(foundElementBefore);
            Assert.AreEqual("type", foundElementBefore.Type);

            model.ChangeElementType(b, "type1");

            IDsmElement foundElementAfter = model.FindElementByFullname("a.b");

            Assert.IsNotNull(foundElementAfter);
            Assert.AreEqual("type1", foundElementAfter.Type);
        }