public void RefreshOrder_RefreshesOrder(List <Project> projects, int position, List <Project> expected) { var sut = new ProjectOrderService(new ProjectRepositoryFake(projects)); sut.RefreshOrder(projects, position); projects.Should().BeEquivalentTo(expected); }
public void MoveUpTest_ReordersProjects(int projectIdToReorder, int newPosition, List <Project> expected) { var projects = SetupBasicProjectData(); var projectToReorder = projects.First(p => p.ID == projectIdToReorder); var sut = new ProjectOrderService(new ProjectRepositoryFake(projects)); sut.MoveUp(projectToReorder, newPosition); projects.Should().BeEquivalentTo(expected); }
public void MoveDown_InvalidPosition_ThrowsException(int newPosition) { var projects = SetupBasicProjectData(); var projectToReorder = projects.First(p => p.ID == 3); var sut = new ProjectOrderService(new ProjectRepositoryFake(projects)); Action actual = () => sut.MoveDown(projectToReorder, newPosition); actual.Should().ThrowExactly <ArgumentException>("Invalid position"); }