예제 #1
0
        public void CalculateOrders_EnumerableNull_ThrowsNullArgumentException()
        {
            var service = new CardService();

            void action() => service.CalculateOrders(null);

            Assert.Throws <ArgumentNullException>(action);
        }
예제 #2
0
        public void CalculateOrders_EnumerableInstance_CallsChangeOrderFromSequence()
        {
            var service = new CardService();
            var card1   = Card.Create("card1-title");
            var card2   = Card.Create("card2-title");
            var cards   = new List <Card> {
                card1, card2
            };

            service.CalculateOrders(cards);

            Assert.Equal(0, card1.Order);
            Assert.Equal(1, card2.Order);
        }