Beispiel #1
0
        public void ParentChildOrder()
        {
            var types = Scopes.GetTypes(Scope.Reference)
                        .Union(new[] { typeof(HrItem), typeof(Vocabulary), typeof(VocabularyWords) })
                        .OrderBy(x => x, new RefModelsComparer())
                        .ToList();

            System.Console.WriteLine(string.Join("\n", types));
            // сначала дети
            Assert.IsTrue(
                types.IndexOf(typeof(VocabularyWords)) <
                types.IndexOf(typeof(Vocabulary)));

            Assert.IsTrue(
                types.IndexOf(typeof(Uom)) <
                types.IndexOf(typeof(HrItem)));

            Assert.IsTrue(
                types.IndexOf(typeof(UomFormat)) <
                types.IndexOf(typeof(Uom)));

            Assert.IsTrue(
                types.IndexOf(typeof(Uom)) <
                types.IndexOf(typeof(UomType)));
        }