Пример #1
0
        public void RollbackTransaction_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.RollbackTransaction();
            }
            catch (Exception ex)
            {
                caughtException = ex;
            }

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