public AccountsLoginService(RiverLaneContext context, IAuthenticationProvider authenticationProvider) { Check.NotNull(context, nameof(context)); Check.NotNull(authenticationProvider, nameof(authenticationProvider)); this.context = context; this.authenticationProvider = authenticationProvider; }
public SettingsEditService(RiverLaneContext context, IMapper mapper) { Check.NotNull(context, nameof(context)); Check.NotNull(mapper, nameof(mapper)); this.context = context; this.mapper = mapper; }
public UsersIndexService(RiverLaneContext context, IMapper mapper) { Check.NotNull(context, nameof(context)); Check.NotNull(mapper, nameof(mapper)); this.context = context; this.mapper = mapper; }
protected override void SetRules(RiverLaneContext context) { RuleFor(x => x.Username) .NotEmpty() .Length(1, 50); RuleFor(x => x.PasswordDetails) .SetValidator(new PasswordModelValidator(context)); }
protected override void SetRules(RiverLaneContext context) { RuleFor(x => x.Password) .Matches(@"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8}.*$") .WithMessage("The password entered does not satisfy the password strength criteria. It must be 8 or more characters long and contain: a lowercase character, an uppercase character and a number."); RuleFor(x => x.ConfirmPassword) .Equal(x => x.Password) .WithMessage("The Password and Confirm Password fields must match."); }
protected DatabaseTest() { context = new RiverLaneContext(); var config = new MapperConfiguration(cfg => AutoMapperConfig.Configure(cfg)); mapper = config.CreateMapper(); deleter.DeleteAll(Context); seeder.Seed(Context); }
protected override void SetRules(RiverLaneContext context) { RuleFor(x => x.ContactEmail) .NotEmpty() .Length(1, 200); RuleFor(x => x.ContactNumber) .NotEmpty() .Length(1, 30); RuleFor(x => x.Address) .SetValidator(new AddressModelValidator(context)); }
protected override void SetRules(RiverLaneContext context) { RuleFor(x => x.HouseName) .Must((model, property) => BePresentIfNothingElseIs(model)).WithMessage("You must specify at least one address field") .Length(1, 50); RuleFor(x => x.Street) .Must((model, property) => BePresentIfNothingElseIs(model)).WithMessage("You must specify at least one address field") .Length(1, 50); RuleFor(x => x.Town) .Must((model, property) => BePresentIfNothingElseIs(model)).WithMessage("You must specify at least one address field") .Length(1, 50); RuleFor(x => x.City) .Must((model, property) => BePresentIfNothingElseIs(model)).WithMessage("You must specify at least one address field") .Length(1, 50); RuleFor(x => x.Postcode) .Must((model, property) => BePresentIfNothingElseIs(model)).WithMessage("You must specify at least one address field") .Length(1, 10); }
public SettingsEditServiceTests() { dummyContext = new Mock <RiverLaneContext>().Object; dummyMapper = new Mock <IMapper>().Object; }
/// <summary> /// Initialises a new instance of the <see cref="RiverLaneFormsTokenProvider"/> class /// </summary> /// <param name="context">A connection to the database</param> public RiverLaneFormsTokenProvider(RiverLaneContext context) { Check.NotNull(context, nameof(context)); this.context = context; }
public AddressModelValidator(RiverLaneContext context) : base(context) { }
public UserCreateService(RiverLaneContext context) { Check.NotNull(context, nameof(context)); this.context = context; }
public AccountsLoginServiceTests() { dummyContext = new Mock <RiverLaneContext>().Object; dummyAuthenticationProvider = new Mock <IAuthenticationProvider>().Object; }
public PasswordModelValidator(RiverLaneContext context) : base(context) { }
protected abstract void SetRules(RiverLaneContext context);
/// <summary> /// Initialises a new instance of a <see cref="ViewModelValidator{T}"/> with a <see cref="RiverLaneContext"/> already made /// </summary> /// <param name="factory"></param> protected ViewModelValidator(RiverLaneContext context) { Check.NotNull(context, nameof(context)); SetRules(context); }
/// <summary> /// Initialises a new instance of the <see cref="RiverLaneFormsAuthenticationProvider"/> class /// </summary> /// <param name="context">A connection to the database</param> public RiverLaneFormsAuthenticationProvider(RiverLaneContext context) { Check.NotNull(context, nameof(context)); this.context = context; }
public TestableFormsTokenProvider(RiverLaneContext context) : base(context) { }
public UsersIndexServiceTests() { dummyContext = new Mock <RiverLaneContext>().Object; dummyMapper = new Mock <IMapper>().Object; }
public TestableFormsAuthenticationProvider(RiverLaneContext context) : base(context) { }