コード例 #1
0
        public void ShouldThrowBusinessExceptionWhileApprovingCancelRequestWhenWrongStatus()
        {
            MandatoryList mandatoryList = new MandatoryListDefault().GetMandatoryListWithStatusApprove();

            mandatoryList.ChangeRequests.Add(new MandatoryListDefault().GetMandatoryListChangeRequest());

            var e = Assert.Throws <BusinessRuleException>(() => mandatoryList.ApproveDelete());

            Assert.Equal(Resources.SharedResources.ErrorMessages.NotAddedAuthorized, e.Message);
        }
コード例 #2
0
        public void ShouldApproveCancelRequest()
        {
            MandatoryList mandatoryList = new MandatoryListDefault().GetMandatoryListWithStatusWaitingCancelRequest();

            mandatoryList.ChangeRequests.Add(new MandatoryListDefault().GetMandatoryListChangeRequest());

            mandatoryList.ApproveDelete();

            Assert.Equal((int)Enums.MandatoryListStatus.Canceled, mandatoryList.StatusId);
        }