public void It_should_change_status_for_item_in_realization_with_invoiced_costs()
        {
            // Given
            var supervisor = new User(_supervisorId, SupervisorName, isSupervisor: true);
            var user       = new User(_userId, UserName);
            var item       = new WishListItem(
                WishListItemStatus.InRealization,
                user,
                CostAmount);

            // When
            item.FinishRealizationBy(supervisor);

            // Then
            Assert.That(item.Status, Is.EqualTo(WishListItemStatus.Realized));
        }
        public void It_should_throw_exception_for_changing_without_permission()
        {
            // Given
            var user = new User(_userId, UserName);

            var item = new WishListItem(
                WishListItemStatus.InRealization,
                user,
                CostAmount);

            // When
            // Then
            Assert.Throws <UserDoesNotHavePermissionToFinishWishListItemRealizationException>(() =>
            {
                item.FinishRealizationBy(
                    user);
            });
        }
        public void It_should_throw_exception_for_incorrect_status(WishListItemStatus status)
        {
            // Given
            var supervisor = new User(_supervisorId, SupervisorName, isSupervisor: true);
            var user       = new User(_userId, UserName);

            var item = new WishListItem(
                status,
                user,
                CostAmount);

            // When
            // Then
            Assert.Throws <CannotFinishWishListItemRealizationWithCurrentStatusException>(() =>
            {
                item.FinishRealizationBy(
                    supervisor);
            });
        }
        public void It_should_throw_exception_for_changing_without_invoiced_costs()
        {
            // Given
            var supervisor = new User(_supervisorId, SupervisorName, isSupervisor: true);
            var user       = new User(_userId, UserName);

            var item = new WishListItem(
                WishListItemStatus.InRealization,
                user,
                CostAmount,
                false);

            // When
            // Then
            Assert.Throws <CannotFinishWishListItemRealizationWithNotInvoicedException>(() =>
            {
                item.FinishRealizationBy(
                    supervisor);
            });
        }