public void TearDownOrganisationTests() { OrganisationContactHandler.DeleteRecordByUserName(_username); OrganisationHandler.DeleteRecordByEndPointAssessorOrganisationId(_organisationIdCreated); OrganisationHandler.DeleteRecordByEndPointAssessorOrganisationId(_org2IdCreated); OrganisationTypeHandler.DeleteRecord(_organisationTypeId); }
public void UpdateOrganisationContactCheckNewDetails() { var contactBeforeChange = OrganisationContactHandler.GetContactById(_contactId.ToString()); var returnedContactId = _repository.UpdateEpaOrganisationContact(_contactUpdated, "Save").Result; var contactAfterChange = OrganisationContactHandler.GetContactById(_contactId.ToString()); _contactBeforeChange.Should().BeEquivalentTo(contactBeforeChange); _contactUpdated.Should().BeEquivalentTo(contactAfterChange); }
public void SetUpOrganisationTests() { _repository = new RegisterRepository(_databaseService.WebConfiguration, new Mock <ILogger <RegisterRepository> >().Object); _validationRepository = new RegisterValidationRepository(_databaseService.WebConfiguration); _organisationIdCreated = "EPA0987"; _organisationTypeId = 5; OrganisationTypeHandler.InsertRecord(new OrganisationTypeModel { Id = _organisationTypeId, Status = "new", Type = "organisation type 1" }); _id = Guid.NewGuid(); _organisation = new OrganisationModel { Id = _id, CreatedAt = DateTime.Now, EndPointAssessorName = "name 2", EndPointAssessorOrganisationId = _organisationIdCreated, PrimaryContact = null, OrganisationTypeId = _organisationTypeId, OrganisationData = null, Status = OrganisationStatus.New }; _username = "******"; OrganisationHandler.InsertRecord(_organisation); _contactId = Guid.NewGuid(); _contactModel = new OrganisationContactModel { Id = _contactId, EndPointAssessorOrganisationId = _organisationIdCreated, OrganisationId = _id, Username = _username, DisplayName = "Joe Cool", Email = "*****@*****.**", PhoneNumber = "555 55555", Status = OrganisationStatus.Live }; _contactBeforeChange = new EpaContact { Id = _contactId, EndPointAssessorOrganisationId = _organisationIdCreated, Username = _username, DisplayName = "Joe Cool", Email = "*****@*****.**", PhoneNumber = "555 55555", Status = OrganisationStatus.Live }; _contactUpdated = new EpaContact { Id = _contactId, EndPointAssessorOrganisationId = _organisationIdCreated, Username = _username, DisplayName = "Joe Cool changes", Email = "*****@*****.**", PhoneNumber = "555 44444", Status = OrganisationStatus.Live }; OrganisationContactHandler.InsertRecord(_contactModel); }