Пример #1
0
        public void MoveDownShouldNotMoveWhenConstrainedByFooId()
        {
            var things = MoveTests.MakeSomeThings().AsQueryable();

            thingRepository.Expect(tr => tr.GetAll()).Return(things);

            orderService.MoveItemAtPosition(3).ConstrainedBy(thing => thing.FooId == 1).DownOne();

            Assert.AreEqual("three", things.Single(t => t.Position == 3).Name);
        }
Пример #2
0
        public void MoveDownShouldMoveElementDown()
        {
            var things = MoveTests.MakeSomeThings().AsQueryable();

            thingRepository.Expect(tr => tr.GetAll()).Return(things);

            // move three down to bottom
            orderService.MoveItemAtPosition(3).DownOne();

            Assert.AreEqual("three", things.Single(t => t.Position == 4).Name);
        }
Пример #3
0
        public void MoveUpShouldMoveElementUp()
        {
            var things = MoveTests.MakeSomeThings().AsQueryable();

            thingRepository.Expect(tr => tr.GetAll()).Return(things);

            // move two up to top
            orderService.MoveItemAtPosition(2).UpOne();

            Assert.AreEqual("two", things.Single(t => t.Position == 1).Name);
        }