コード例 #1
0
        public WorkEventLogTest()
        {
            this.address           = this.addressFactory.Create();
            this.permissionManager = new ContractExecutor(this.addressFactory.Create());
            this.contractRegistry  = new ContractRegistry();
            this.workTracker       = new WorkTracker.WorkTracker(this.addressFactory.Create(), this.contractRegistry,
                                                                 this.permissionManager.Address);
            var perm    = new Permission(typeof(TrackWorkAction));
            var addPerm = new AddPermissionAction(string.Empty, this.workTracker.Address, perm,
                                                  this.permissionManager.Address);

            this.contractRegistry.RegisterContract(this.permissionManager);
            this.contractRegistry.RegisterContract(this.workTracker);

            this.permissionManager.ExecuteAction(addPerm);

            var eventSet = new HashSet <WorkEventArgs>()
            {
                new WorkEventArgs(5, new DateTime(2019, 5, 13), this.address),
                new WorkEventArgs(5, new DateTime(2019, 5, 14), this.address),
                new WorkEventArgs(5, new DateTime(2019, 5, 15), this.address),
                new WorkEventArgs(5, new DateTime(2019, 5, 16), this.address),
            };

            this.eventLog = new WorkEventLog(30, eventSet, this.workTracker);
        }
コード例 #2
0
        public WorkTrackerTest()
        {
            this.address           = this.addressFactory.Create();
            this.permissionManager = new ContractExecutor(this.addressFactory.Create());
            this.contractRegistry  = new ContractRegistry();
            this.workTracker       = new WorkTracker.WorkTracker(
                this.addressFactory.Create(),
                this.contractRegistry,
                this.permissionManager.Address);

            this.contractRegistry.RegisterContract(this.permissionManager);
            this.contractRegistry.RegisterContract(this.workTracker);

            this.ConfigurePermissions();
        }