예제 #1
0
        public void InitSharedTransaction_Executed_ExecutesWithNoException()
        {
            var roleRepository                   = Substitute.For <IRoleRepository>();
            var userRepository                   = Substitute.For <IUserRepository>();
            var functionRepository               = Substitute.For <IFunctionRepository>();
            var teamRepository                   = Substitute.For <ITeamRepository>();
            var applicationRepository            = Substitute.For <IApplicationRepository>();
            var applicationDataPolicyRepository  = Substitute.For <IApplicationDataPolicyRepository>();
            var ldapAuthenticationModeRepository = Substitute.For <ILdapAuthenticationModeRepository>();

            securityContractDefaultConfigurationService = new SecurityContractDefaultConfigurationService(roleRepository, userRepository, functionRepository, teamRepository, applicationRepository, applicationDataPolicyRepository, ldapAuthenticationModeRepository);

            Exception caughtException = null;

            try
            {
                securityContractDefaultConfigurationService.InitSharedTransaction();
            }
            catch (Exception ex)
            {
                caughtException = ex;
            }

            Assert.True(caughtException == null, "InitSharedTransaction must not throw an exception.");
        }
 private void BeginAllTransactions()
 {
     securityContractApplicationService.InitSharedTransaction();
     securityContractDefaultConfigurationService.InitSharedTransaction();
     clientService.InitSharedTransaction();
 }