示例#1
0
        public void GivenModelIsEmptyWhenImportRelationIsCalledThenItsHasOneRelation()
        {
            DsmRelationModel model = new DsmRelationModel(_elementsDataModel);

            Assert.AreEqual(0, model.GetExportedRelationCount());

            IDsmRelation relation = model.ImportRelation(1, _a.Id, _b.Id, "type", 1, false);

            Assert.IsNotNull(relation);

            Assert.AreEqual(1, model.GetExportedRelationCount());
        }
示例#2
0
        public void GivenModelIsNotEmptyWhenClearIsCalledThenItIsEmpty()
        {
            DsmRelationModel model = new DsmRelationModel(_elementsDataModel);

            Assert.AreEqual(0, model.GetExportedRelationCount());

            model.AddRelation(_a.Id, _b.Id, "type", 1);
            Assert.AreEqual(1, model.GetExportedRelationCount());

            model.Clear();

            Assert.AreEqual(0, model.GetExportedRelationCount());
        }
示例#3
0
        public void GivenModelIsFilledWhenGetWeightWithSelfThenReturnsZero()
        {
            DsmRelationModel model = new DsmRelationModel(_elementsDataModel);

            CreateElementRelations(model);
            Assert.AreEqual(11, model.GetExportedRelationCount());

            foreach (IDsmElement element in _elementsDataModel.GetElements())
            {
                Assert.AreEqual(0, model.GetDependencyWeight(element.Id, element.Id));
            }
        }
示例#4
0
        public void WhenModelIsConstructedThenItIsEmpty()
        {
            DsmRelationModel model = new DsmRelationModel(_elementsDataModel);

            Assert.AreEqual(0, model.GetExportedRelationCount());
        }