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()); }
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()); }
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)); } }
public void WhenModelIsConstructedThenItIsEmpty() { DsmRelationModel model = new DsmRelationModel(_elementsDataModel); Assert.AreEqual(0, model.GetExportedRelationCount()); }