Example #1
0
        public void SortByLevelOnNullDoesntThrow()
        {
            List <Deck> decks = null;

            DeckTreeDictionary.SortByLevel(decks);

            Assert.Equal(decks, null);
        }
Example #2
0
        public void SortByLevelOnEmptyReturnsEmpty()
        {
            List <Deck> decks = new List <Deck>();

            DeckTreeDictionary.SortByLevel(decks);

            Assert.NotNull(decks);
            Assert.Empty(decks);
        }
Example #3
0
        public void SortByLevelSortsByLevel()
        {
            var decks = new List <Deck>();

            decks.Add(new Deck()
            {
                Name = "parent::child", ToImport = true
            });
            decks.Add(new Deck()
            {
                Name = "parent", ToImport = false
            });
            decks.Add(new Deck()
            {
                Name = "parent::child::grandchild", ToImport = true
            });

            DeckTreeDictionary.SortByLevel(decks);

            Assert.True(decks[0].Name == "parent");
            Assert.True(decks[1].Name == "parent::child");
            Assert.True(decks[2].Name == "parent::child::grandchild");
        }