public void DealManager_Put_ShouldCall_RepositorySave(BLL_Deal entity, string bypassCedantBrokerValidation)
        {
            #region Arrange
            Mock <IDealRepository>            dealRepository            = new Mock <IDealRepository>();
            Mock <IWorkbenchDealsRepository>  workbenchDealsRepository  = new Mock <IWorkbenchDealsRepository>();
            Mock <IDealStatusesLookupManager> dealStatusesLookupManager = new Mock <IDealStatusesLookupManager>();
            Mock <ITblDealRepository>         tblDealRepository         = SetupTblDealRepository(false);
            Mock <ICedantManager>             cedantManager             = SetupCedant();
            Mock <IBrokerManager>             brokerManager             = SetupBroker();

            SetupUserIdentity();
            SetupDealRepository(dealRepository, false, bypassCedantBrokerValidation);

            DealManager dealManager = new DealManager(userManager.Object, cacheStoreManager, mockLogManager.Object, dealRepository.Object, workbenchDealsRepository.Object, tblDealRepository.Object, dealStatusesLookupManager.Object, dealLockManager.Object, transformationManager, cedantManager.Object, brokerManager.Object, new Mock <ITblClausesDealRepository>().Object);
            #endregion

            #region Act
            EntityResult <BLL_Deal> actual = dealManager.UpdateDeal(entity);
            #endregion

            #region  Assert
            dealRepository.Verify(p => p.Get(It.IsAny <Expression <Func <grs_VGrsDeal, bool> > >()));
            tblDealRepository.Verify(p => p.Save(It.IsAny <TblDeal>(), false));

            Assert.IsNotNull(actual.Data);
            Assert.AreEqual(entity.Dealnum, actual.Data.Dealnum);
            Assert.AreEqual(entity.Dealname, actual.Data.Dealname);

            #endregion
        }
        public void DealManager_Put_ShouldCall_Validate(BLL_Deal entity, string bypassCedantBrokerValidation, bool hasValidCompanyGroup)
        {
            #region Arrange
            Mock <IDealRepository>            dealRepository            = new Mock <IDealRepository>();
            Mock <IWorkbenchDealsRepository>  workbenchDealsRepository  = new Mock <IWorkbenchDealsRepository>();
            Mock <IDealStatusesLookupManager> dealStatusesLookupManager = new Mock <IDealStatusesLookupManager>();
            Mock <ITblDealRepository>         tblDealRepository         = SetupTblDealRepository(false);
            Mock <ICedantManager>             cedantManager             = SetupCedant(hasValidCompanyGroup);
            Mock <IBrokerManager>             brokerManager             = SetupBroker(hasValidCompanyGroup);

            SetupUserIdentity();
            SetupDealRepository(dealRepository, false, bypassCedantBrokerValidation);

            DealManager dealManager = new DealManager(userManager.Object, cacheStoreManager, mockLogManager.Object, dealRepository.Object, workbenchDealsRepository.Object, tblDealRepository.Object, dealStatusesLookupManager.Object, dealLockManager.Object, transformationManager, cedantManager.Object, brokerManager.Object, new Mock <ITblClausesDealRepository>().Object);
            #endregion

            #region Act
            #endregion

            #region  Assert
            Assert.Throws <IllegalArgumentAPIException>(delegate { dealManager.UpdateDeal(entity); });
            #endregion
        }