public void Arrange() { Setup(); MappingBootstrapper.Initialize(); _contactResponse = Builder <Contact> .CreateNew().Build(); ContactQueryRepositoryMock.Setup(q => q.GetContact(Moq.It.IsAny <string>())) .Returns(Task.FromResult((_contactResponse))); _result = ContactQueryController.SearchContactByUserName("TestUser").Result; }
public void Arrange() { Setup(); _updateContactRequest = Builder <UpdateContactRequest> .CreateNew() .With(q => q.Email = "*****@*****.**") .Build(); ContactQueryRepositoryMock.Setup(q => q.CheckContactExists(Moq.It.IsAny <string>())) .Returns(Task.FromResult(true)); _validationResult = UpdateContactRequestValidator.Validate(_updateContactRequest); }
public void Arrange() { Setup(); UpdateOrganisationRequest = Builder <UpdateOrganisationRequest> .CreateNew() .With(q => q.EndPointAssessorName = null) .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((false))); _validationResult = UpdateOrganisationRequestValidator.Validate(UpdateOrganisationRequest); }
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); }
public void Arrange() { Setup(); MappingBootstrapper.Initialize(); var contacts = Builder <Contact> .CreateListOfSize(10).Build().AsEnumerable(); ContactQueryRepositoryMock.Setup(q => q.GetContactsForEpao(Moq.It.IsAny <string>())) .Returns(Task.FromResult((contacts))); OrganisationQueryRepositoryMock.Setup(q => q.CheckIfAlreadyExists(Moq.It.IsAny <string>())) .Returns(Task.FromResult <bool>(true)); var endPointAssessorOrganisationId = "EPA1234"; _result = ContactQueryController.SearchContactsForAnOrganisation(endPointAssessorOrganisationId).Result; }
public void Arrange() { Setup(); CreateOrganisationRequest = Builder <CreateOrganisationRequest> .CreateNew() .With(q => q.EndPointAssessorOrganisationId = "1234567890123456") .With(q => q.EndPointAssessorUkprn = 10000001) .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 = CreateOrganisationRequestValidator.Validate(CreateOrganisationRequest); }
public void Arrange() { Setup(); var contactRequest = Builder <UpdateContactRequest> .CreateNew() .With(q => q.UserName = q.UserName.PadLeft(40, 'x')) .With(q => q.DisplayName = q.DisplayName.PadLeft(140, 'x')) .With(q => q.Email = q.Email.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 = UpdateContactRequestValidator.Validate(contactRequest); }