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); }
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); }
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); }