private void GenerateComponents(CobieSpace space, int count) { var model = space.Model; var rnd = new Random(79); var type = model.Instances.New <CobieType>(t => { t.Name = "Type " + _typeCounter++; t.CodePerformance = "Great"; t.AccessibilityPerformance = "Easy"; t.Color = "Uncertain"; t.ExpectedLife = 100; var cIndex = (int)(rnd.NextDouble() * 10) - 1; t.Manufacturer = model.Instances.OfType <CobieContact>().ToList()[cIndex]; }); for (var i = 0; i < count; i++) { var i1 = i; model.Instances.New <CobieComponent>(c => { c.Type = type; c.Spaces.Add(space); c.Name = _rThings[i1]; GenerateAttributes(c, 8); }); } }
private void CompareTrees(CobieSpace spaceLeft, CobieSpace spaceRight) { Assert.AreEqual(spaceLeft.ExternalId, spaceRight.ExternalId); Assert.AreEqual(spaceLeft.AltExternalId, spaceRight.AltExternalId); Assert.AreEqual(spaceLeft.Name, spaceRight.Name); Assert.AreEqual(spaceLeft.Components.Count(), spaceRight.Components.Count(), "Component count missmatch"); }