public EntityCollection(StepModel model, int labelFrom = 0)
 {
     CurrentLabel = Math.Max(CurrentLabel, labelFrom);
     _model       = model;
     _internal    =
         XbimMultiValueDictionary <Type, IPersistEntity> .Create(
             () => new HashSet <IPersistEntity>(new EntityLabelComparer()));
 }
Exemplo n.º 2
0
        public void Can_Sort()
        {
            var dict = new XbimMultiValueDictionary<int, XbimRect3D>
            {
                { 1, new XbimRect3D(0, 0, 0, 1, 1, 1) },
                { 2, new XbimRect3D(0, 0, 0, 3, 3, 3) },
                { 2, new XbimRect3D(0, 0, 0, 1, 1, 1) },
                { 3, new XbimRect3D(0, 0, 0, 2, 2, 2) },
                { 3, new XbimRect3D(0, 0, 0, 4, 4, 4) },
            };

            var sorted = dict.OrderByDescending(k => k.Value.First().Volume).ToList();

            sorted.Should().BeInDescendingOrder(new FirstVolumeComparer()  );
            sorted.First().Key.Should().Be(2);
            sorted.Last().Key.Should().Be(1);
        }