Пример #1
0
 // ReSharper disable once UnusedMember.Global
 public void Initialize()
 {
     _auditor = new Auditor(UnitTestHelper.FakeAuditingClient.Object);
     _authenticationManager = UnitTestHelper.FakeSecurity.Object;
     _userGroupManager = UnitTestHelper.FakeUserGroupManager.Object;
     _randomizer = new Randomizer();
 }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ConfigurationManager"/> class.
        /// </summary>
        /// <param name="repository">The repository.</param>
        /// <param name="auditor">The auditor.</param>
        public ConfigurationManager(IRepository repository, IPledgeAuditor auditor)
        {
            int version;
            var currentVersion = System.Configuration.ConfigurationManager.AppSettings[PledgeGlobal.CurrentVersion];

            if (!int.TryParse(currentVersion, out version))
            {
                version = 1;
            }

            CurrentVersion = version;
            Repository = repository;
            Auditor = auditor;
        }
Пример #3
0
        public void Save(IPledgeAuditor auditor)
        {
            /*
            using (var bulkCopy = new SqlBulkCopy(_connection.ConnectionString))
            {
                bulkCopy.DestinationTableName = "Core.AuditLog";
                bulkCopy.ColumnMappings.Add("SessionId", "SessionId");
                bulkCopy.ColumnMappings.Add("RunId", "RunId");
                bulkCopy.ColumnMappings.Add("MessageDescription", "MessageDescription");
                bulkCopy.ColumnMappings.Add("MessageDescription", "MessageDescription");
                bulkCopy.ColumnMappings.Add("DateCreated", "DateCreated");
                bulkCopy.ColumnMappings.Add("UpdatedBy", "UpdatedBy");
                bulkCopy.BulkCopyTimeout = 600;

                bulkCopy.WriteToServer(auditor);
            }
            */
        }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PledgeManager" /> class.
 /// </summary>
 /// <param name="configurationManager">The configuration manager.</param>
 /// <param name="builder">The builder.</param>
 /// <param name="auditor">The auditor.</param>
 public PledgeManager(IConfigurationManager configurationManager, IBuilder builder, IPledgeAuditor auditor)
 {
     Builder = builder;
     Auditor = auditor;
     ConfigurationManager = configurationManager;
 }
Пример #5
0
 public void Initialize()
 {
     _auditor = new Pledge.Core.Auditing.Auditor(UnitTestHelper.FakeAuditingClient.Object);
     _randomizer = new Randomizer();
 }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ConfigurationController" /> class.
 /// </summary>
 /// <param name="pledgeAuditor">The pledge auditor.</param>
 /// <param name="userGroupManager">The user group manager.</param>
 /// <param name="authenticationManager">The authentication manager.</param>
 public AuditController(IPledgeAuditor pledgeAuditor, IUserGroupManager userGroupManager, IAuthenticationManager authenticationManager)
 {
     _pledgeAuditor = pledgeAuditor;
     _userGroupManager = userGroupManager;
     _authenticationManager = authenticationManager;
 }