Ejemplo n.º 1
0
 public CreatePokerSessionCommandHandler(IPokerTimeDbContext pokerTimeDbContext, IPassphraseService passphraseService, ISystemClock systemClock, IUrlGenerator urlGenerator, ILogger <CreatePokerSessionCommandHandler> logger)
 {
     this._pokerTimeDbContext = pokerTimeDbContext;
     this._passphraseService  = passphraseService;
     this._systemClock        = systemClock;
     this._urlGenerator       = urlGenerator;
     this._logger             = logger;
 }
 public CreateRetrospectiveCommandHandler(IReturnDbContext returnDbContext, IPassphraseService passphraseService, ISystemClock systemClock, IUrlGenerator urlGenerator, ILogger <CreateRetrospectiveCommandHandler> logger)
 {
     this._returnDbContext   = returnDbContext;
     this._passphraseService = passphraseService;
     this._systemClock       = systemClock;
     this._urlGenerator      = urlGenerator;
     this._logger            = logger;
 }
        public JoinRetrospectiveCommandValidator(IReturnDbContextFactory returnDbContext, IPassphraseService passphraseService)
        {
            this._returnDbContext   = returnDbContext;
            this._passphraseService = passphraseService;

            this.RuleFor(e => e.Name).NotEmpty().MaximumLength(256);
            this.RuleFor(e => e.Color).NotEmpty().Matches("^#?([A-F0-9]{2}){3}$", RegexOptions.IgnoreCase);

            this.RuleFor(e => e.Passphrase)
            .NotEmpty()
            .When(x => x.JoiningAsFacilitator);

            // Passphrase validation
            this.RuleFor(e => e.Passphrase).
            Must((obj, passphrase) => this.MustBeAValidPassphrase(obj.RetroId, obj.JoiningAsFacilitator, obj.Passphrase))
            .WithMessage("This passphrase is not valid. Please try again.");
        }
Ejemplo n.º 4
0
        public JoinPokerSessionCommandValidator(IPokerTimeDbContextFactory pokerTimeDbContext, IPassphraseService passphraseService)
        {
            this._pokerTimeDbContext = pokerTimeDbContext;
            this._passphraseService  = passphraseService;

            this.RuleFor(e => e.Name).NotEmpty().MaximumLength(256);
            this.RuleFor(e => e.Color).NotEmpty()
            .WithMessage("Please select a color")
            .Matches("^#?([A-F0-9]{2}){3}$", RegexOptions.IgnoreCase)
            .WithMessage("Please select a color");

            this.RuleFor(e => e.Passphrase)
            .NotEmpty()
            .When(x => x.JoiningAsFacilitator);

            // Passphrase validation
            this.RuleFor(e => e.Passphrase).
            Must((obj, passphrase) => this.MustBeAValidPassphrase(obj.SessionId, obj.JoiningAsFacilitator, obj.Passphrase))
            .WithMessage("This passphrase is not valid. Please try again.");
        }