public void Arrange()
        {
            Setup();

            ContactRequest = new CreateContactRequest(Moq.It.IsAny <string>(), Moq.It.IsAny <string>(),
                                                      Moq.It.IsAny <string>(), Moq.It.IsAny <string>(), Moq.It.IsAny <string>());

            _validationResult = CreateContactRequestValidator.Validate(ContactRequest);
        }
Beispiel #2
0
        public void Arrange()
        {
            Setup();

            ContactQueryRepositoryMock.Setup(q => q.CheckContactExists(Moq.It.IsAny <string>()))
            .Returns(Task.FromResult((false)));

            OrganisationQueryRepositoryMock.Setup(q => q.CheckIfAlreadyExists(Moq.It.IsAny <string>()))
            .Returns(Task.FromResult((true)));

            ContactRequest = Builder <CreateContactRequest> .CreateNew()
                             .With(q => q.Email = "*****@*****.**")
                             .Build();

            _validationResult = CreateContactRequestValidator.Validate(ContactRequest);
        }
Beispiel #3
0
        public void Setup()
        {
            _mockStringLocaliserBuilder = new MockStringLocaliserBuilder();

            _contactCreateRequestValidatorLocaliser = _mockStringLocaliserBuilder
                                                      .WithKey(ResourceMessageName.NoAssesmentProviderFound)
                                                      .WithKeyValue("100000000")
                                                      .Build <CreateContactRequestValidator>();

            ContactQueryRepositoryMock      = new Mock <IContactQueryRepository>();
            OrganisationQueryRepositoryMock = new Mock <IOrganisationQueryRepository>();

            CreateContactRequestValidator = new CreateContactRequestValidator(
                _contactCreateRequestValidatorLocaliser.Object,
                OrganisationQueryRepositoryMock.Object,
                ContactQueryRepositoryMock.Object);
        }
        public void Arrange()
        {
            Setup();

            ContactRequest = Builder <CreateContactRequest>
                             .CreateNew()
                             .With(q => q.Username = q.Username.PadLeft(40, 'x'))
                             .With(q => q.Email    = q.Email.PadLeft(140, 'x'))
                             .With(q => q.EndPointAssessorOrganisationId = q.EndPointAssessorOrganisationId.PadLeft(140, 'x'))
                             .With(q => q.FamilyName  = q.FamilyName.PadLeft(140, 'x'))
                             .With(q => q.GivenName   = q.GivenName.PadLeft(140, 'x'))
                             .With(q => q.DisplayName = q.DisplayName.PadLeft(140, 'x'))
                             .Build();

            ContactQueryRepositoryMock.Setup(q => q.CheckContactExists(Moq.It.IsAny <string>()))
            .Returns(Task.FromResult((false)));

            OrganisationQueryRepositoryMock.Setup(q => q.CheckIfAlreadyExists(Moq.It.IsAny <string>()))
            .Returns(Task.FromResult((true)));


            _validationResult = CreateContactRequestValidator.Validate(ContactRequest);
        }