Example #1
0
        public void ShouldThrowBusinessExceptionWhileApprovingEditRequestWhenWrongStatus()
        {
            MandatoryList mandatoryList = new MandatoryListDefault().GetMandatoryListWithProdcuts();

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

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

            Assert.Equal(Resources.SharedResources.ErrorMessages.NotAddedAuthorized, e.Message);
        }
Example #2
0
        public void ShouldApproveEditRequest()
        {
            MandatoryList mandatoryList = new MandatoryListDefault().GetMandatoryListWithStatusApprove();

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

            mandatoryList.ApproveEdit();

            Assert.Equal((int)Enums.MandatoryListChangeRequestStatus.Approved, mandatoryList.ChangeRequests.FirstOrDefault().StatusId);
        }