public void It_should_change_status_to_rejected_when_requested() { // Given var leader = new User(_leaderId, LeaderName); var user = new User(_userId, UserName, leader); var item = new WishListItem( WishListItemStatus.Requested, user, CostAmountWithAdditionalAcceptance); // When item.RejectBy(leader); // Then Assert.That(item.Status, Is.EqualTo(WishListItemStatus.Rejected)); }
public void It_should_throw_exception_for_changing_from_requested_without_permission() { // Given var leader = new User(_leaderId, LeaderName); var user = new User(_userId, UserName, leader); var item = new WishListItem( WishListItemStatus.Requested, user, CostAmountWithoutAdditionalAcceptance); // When // Then Assert.Throws <UserDoesNotHavePermissionToRejectRequestedWishListItemException>(() => { item.RejectBy(user); }); }
public void It_should_change_status_to_rejected_when_requested_to_director() { // Given var director = new User(_directorId, DirectorName); var department = new Department(DepartmentName, director); var user = new User( _userId, UserName, department: department); var item = new WishListItem( WishListItemStatus.RequestedToDirector, user, CostAmountWithAdditionalAcceptance); // When item.RejectBy(director); // Then Assert.That(item.Status, Is.EqualTo(WishListItemStatus.Rejected)); }
public void It_should_throw_exception_for_changing_from_requested_to_director_without_permission() { // Given var director = new User(_directorId, DirectorName); var department = new Department(DepartmentName, director); var user = new User( _userId, UserName, department: department); var item = new WishListItem( WishListItemStatus.RequestedToDirector, user, CostAmountWithAdditionalAcceptance); // When // Then Assert.Throws <UserDoesNotHavePermissionToRejectRequestedWishListItemException>(() => { item.RejectBy(user); }); }
public void It_should_throw_exception_for_incorrect_status(WishListItemStatus status) { // Given var leader = new User(_leaderId, LeaderName); var user = new User(_userId, UserName, leader); var item = new WishListItem( status, user, CostAmountWithoutAdditionalAcceptance); // When // Then Assert.Throws <CannotRejectWishListItemWithCurrentStatusException>(() => { item.RejectBy(leader); }); }