Example #1
0
        public void GivenIndirectCycleExistsBetweenElementsWhenIsCyclicDependencyThenReturnsCycleTypeHierarchical()
        {
            DsmRelationModel model = new DsmRelationModel(_elementsDataModel);

            CreateElementRelations(model);

            Assert.AreEqual(1234, model.GetDependencyWeight(_a.Id, _b.Id));
            Assert.AreEqual(5, model.GetDependencyWeight(_b.Id, _a.Id));
            Assert.AreEqual(CycleType.Hierarchical, model.IsCyclicDependency(_a.Id, _b.Id));
        }
Example #2
0
        public void GivenNoCycleExistsBetweenElementsWhenIsCyclicDependencyThenReturnsFalse()
        {
            DsmRelationModel model = new DsmRelationModel(_elementsDataModel);

            CreateElementRelations(model);

            Assert.AreEqual(5, model.GetDependencyWeight(_a1.Id, _c2.Id));
            Assert.AreEqual(0, model.GetDependencyWeight(_c2.Id, _a1.Id));
            Assert.AreEqual(CycleType.None, model.IsCyclicDependency(_a1.Id, _c2.Id));
        }
Example #3
0
        public void GivenDirectCycleExistsBetweenElementsWhenIsCyclicDependencyThenReturnsCycleTypeSystem()
        {
            DsmRelationModel model = new DsmRelationModel(_elementsDataModel);

            CreateElementRelations(model);

            Assert.AreEqual(1, model.GetDirectDependencyWeight(_c1.Id, _c2.Id));
            Assert.AreEqual(1, model.GetDirectDependencyWeight(_c2.Id, _c1.Id));
            Assert.AreEqual(CycleType.System, model.IsCyclicDependency(_c1.Id, _c2.Id));
        }