Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Adds IAuthorizableTask and related classes * Add AuthorizableTask query,handler and fake * Implemented test: UpdateUserProfileCompletenessSendsRemoveUserProfileIncompleteClaimCommandWithCorrectUserIdWhenUsersProfileIsComplete() * Implemented Test: UpdateUserProfileCompletenessInvokesRefreshSignInAsyncWithCorrectUserWhenUsersProfileIsComplete() * Implemented test: ResendEmailConfirmationInvokesGenerateEmailConfirmationTokenAsyncWithCorrectUser() * Implemented tests: ResendEmailConfirmationInvokesUrlActionWithCorrectParameters() * Implemented test ResendEmailConfirmationSendsSendConfirmAccountEmailAsyncWithCorrectData() * Implemented tests: ResendEmailConfirmationRedirectsToCorrectAction() ResendEmailConfirmationHasHttpPostAttribute() ResendEmailConfirmationHasHttpValidateAntiForgeryTokenAttribute() EmailConfirmationSentReturnsAView() * test * Implemented tests: EnableTwoFactorAuthenticationInvokesSetTwoFactorEnabledAsyncWhenUserIsNotNull() EnableTwoFactorAuthenticationInvokesSignInAsyncWhenUserIsNotNull() RemoveLoginHasHttpPostAttribute() RemoveLoginHasValidateAntiForgeryTokenAttribute() * Implemented Test: EnableTwoFactorAuthenticationSendsUserByUserIdQueryWithCorrectUserId() * Implemented Tests: EnableTwoFactorAuthenticationRedirectsToCorrectAction() EnbaleTwoFactorAuthenticationHasHttpPostAttribute() EnableTwoFactorAuthenticationHasValidateAntiForgeryTokenAttribute() * Implemented all tests for DisableTwoFactorAuthentication() Controller Action * Implemented Tests for GetChangePassword Action. * Implemented tests: ChangePasswordPostSendsUserByUserIdQueryWithCorrectUserId() ChangePasswordPostInvokesChangePasswordAsyncWithCorrectParametersWhenUserIsNotNull() * Fix admin menu in integrations test * Fixes - Duplicate event button showing for event managers * Updates EventController to use AuthorizableEvent Fixes related EventController unit tests * Updates EventController create methods to use AuthorizableCampaign Adds AuthorizableCampaignQuery Adds FakeAuthorizableCampaign Exposes FakeAuthorizableEvent * Updates ItineraryController to use AuthorizableItinerary * Updates RequestController to use AuthorizableRequest * Updates TaskController to use AuthorizableTask * Fixes RequestController and TaskController creation error with new Authorization model * Fixes EventController - no need to check for authorization to be null * Fixes image deleted when image is updated for CampaignController * Fixes image deleted when image is updated for EventController Fixes wrong parameters sent to UploadEventImageAsync method * Updates CampaignController to use AuthorizableCampaign * Adds AuthorizableOrganization * Adds AuthorizableOrganization tests * Updates CampaignController to use AuthorizableOrganization * first commit at trying to improve the image/task attachment azure blob code - added BlockBlockServiceBase abstrct class. - it uses the template method to force the implemenation of the ContainerName property on classes that inherit from it. - ImageService and TaskAttachmentService inherit from it. - this class will allow the testing of the correct blob name being constructed before uploading it to blob storage. - this class also allows the user to set a whitelist and/or blacklist of extensions that will allow or disallow a particular file extension to be uploaded. Althought this is nice, we really should be whitelisting/blacklisting at the point we receive data from the UI using ViewModels and the ModelBinder. - ImageService and TaskAttachmentService now allow the testing of the correct blobPath being built before passing it to the inherited UploadAsync method - added BlockBlob class which implements IBlockBlob. IBlockBlob is injected into BlockBlobServiceBase via its implementors - the purpose of BlockBlox is to isolate the azure specific api. this class is only responsible for doing azure specific calls to authenticate, get the container, the blockBlob and either upload or delete the blob. * this commit removes the concept of the BlockBlobServiceBase as it was not really needed. - the ImageService and TaskAttachmentService have returned to owning their container names as well as taking care of any file validations (whitelist/blacklist) based on what they need to do - both classes now directly use IBlockBlob which encapsulates the azure blob storage calls - this should make both ImagesSerivce adn TaskAttachment service testable to make sure they're building the correct blob name before invoking IBlockBlob API calls and/or validating that files with the wrong extension are not uploaded. * code cleanup/renaming * Added a unit test for SendRequestStatusToGetASmokeAlarmHandler. All paths are handled but depending on feedback I could split up the tests verifying the various mapping combinations into separate tests. This would introduce some duplication though so I'm not sure that'd be the best approach * Some general cleanup. Sorted the using statements and removed "this." qualifiers as per the code style applied to the other tests I found. * Added a check for the providerRequestId as well. Renamed the method to clarify what we're asserting for. * Forgot to remove some more "this." goodness. * Added basic unit test to cover the SendInProgressStatusToGetASmokeAlarmHandler * - restore original value for nableAzureBlobImageService in config.json - delete unused SendGridDevelopmentWeb class file * Added some ignore rules for ncrunch project and solution extensions * Added a check to ensure the right method call is being enqueued. * Changed the GasaStatus "Enumeration" to expose constants instead of statics, allowing for their usage in the test cases. Replaced raw string values with the GasaStatus Enum, to ensure renames/refactorings do not inadvertedly break the test. * Moved !-circle to be before user name when logged in with incomplete profile to not cover caret * Updating UserAuthorizationService to expose IsEventManager, IsCampaignManager, IsTeamLead * Unit Tests * changing strings to use nameof() #340 (partial) action names, model property names (in error messages) and changing ResourceAdminController.Create from nameof() to a string b/c it was referencing the wrong class (a model and not the controller) * Updated to work with the latest changes on master branch * Fixed using statements in VolunteerTaskAttachmentService * change runtime UserType name lookups to compile-time nameof() lookup #340 (partial) * Renam FileImageService to FakeImageService * Issue 1603 - Unit Test for GetMyEventsQueryHandler * Remove events from locked or not published campaigns from start page * Changed locale on the datetime picker to match the culture set in startup.cs * adds view and action for compaign manager * adds query to retrieve the campaign that campaign manager authorized to manage * adds logic to action and change the view to show the campaign manager assigned campaign and direct user to campaign admin page * adds test for AuthorizedCampaignsQueryHandler * adds unit test for Campaign controller ManagerCampaign action * changes the campaign controller tests to reflect the new changes in campaign constructor * changes the implementation that show the manage button to the user on campaign index and adds test for it * changes manage campaign view model to work with the campaign.js ko model * changes the campaign controller test to reflect the new changes * delete the campaign js copy that causes the build to fail * changes the campaign controller test and removes the fake user manager class, also change the manage campaign view model to reflect the requested changes * Remove FakUserManager class fully from UserAuthorizationServiceTests - half-way finished with removal from ItineraryAdminControllerTests * Remove FakeUserManager and FakeUserManagerForBasicUser classes from UserAuthorizationServiceTests. - split MockHelper into two separate classes; SignInManagerMockHelper and UserManagerMockHelper and move the each method inMockHelper to the appropriately named class - the class names are more descriptive as to what they do and they should be easier to find. - all the other files affected by the MockHelper split * Change any MockHelper references left in CampaignControllerTests to UserManagerMockHelper * Fix two skipped CampaignAdminControllerTests tests marked as broken; (#2006) DeleteConfirmedSendsDeleteCampaignCommandWithCorrectCampaignId PublishConfirmedSendsPublishCampaignCommandWithCorrectCampaignId * Change name of TaskAttachmentService to AttachmentService (#1995) * Rename ITaskAttachmentService/TaskAttachmentService to IAttachmentService/AttachmentService - change method names to specify uploading an attachment for a given resource - aka, so UploadAsync becomes up UploadTaskAttachmentAsync and DeleteAsync becomes DeleteAttachmentAsync * code clean up * Renamed task views and view models (#1987) * Renamed "Task" to "VolunteerTask". Adjusted the namespaces as well, which cascaded to quite a few classes. Sorted out the namespace includes as well, based on the established convention. * Renamed Testing namespace and test class for ViewModels\Validators\VolunteerTask\* to match the rename from Task to VolunteerTask. * Task Attachment Renames #1939 (#1993) * Rename ITaskAttachmentService to IVolunteerAttachmentService * Rename parameter taskId to volunteerTaskId * Amend Azure path to 'volunteerTask/' * Make change to FileAttachment model * Implemented test: UpdateUserProfileCompletenessSendsRemoveUserProfileIncompleteClaimCommandWithCorrectUserIdWhenUsersProfileIsComplete() * Implemented Test: UpdateUserProfileCompletenessInvokesRefreshSignInAsyncWithCorrectUserWhenUsersProfileIsComplete() * Implemented test: ResendEmailConfirmationInvokesGenerateEmailConfirmationTokenAsyncWithCorrectUser() * Implemented tests: ResendEmailConfirmationInvokesUrlActionWithCorrectParameters() * Implemented test ResendEmailConfirmationSendsSendConfirmAccountEmailAsyncWithCorrectData() * Implemented tests: ResendEmailConfirmationRedirectsToCorrectAction() ResendEmailConfirmationHasHttpPostAttribute() ResendEmailConfirmationHasHttpValidateAntiForgeryTokenAttribute() EmailConfirmationSentReturnsAView() * test * Implemented tests: EnableTwoFactorAuthenticationInvokesSetTwoFactorEnabledAsyncWhenUserIsNotNull() EnableTwoFactorAuthenticationInvokesSignInAsyncWhenUserIsNotNull() RemoveLoginHasHttpPostAttribute() RemoveLoginHasValidateAntiForgeryTokenAttribute() * Implemented Test: EnableTwoFactorAuthenticationSendsUserByUserIdQueryWithCorrectUserId() * Implemented Tests: EnableTwoFactorAuthenticationRedirectsToCorrectAction() EnbaleTwoFactorAuthenticationHasHttpPostAttribute() EnableTwoFactorAuthenticationHasValidateAntiForgeryTokenAttribute() * Implemented all tests for DisableTwoFactorAuthentication() Controller Action * Implemented Tests for GetChangePassword Action. * Implemented tests: ChangePasswordPostSendsUserByUserIdQueryWithCorrectUserId() ChangePasswordPostInvokesChangePasswordAsyncWithCorrectParametersWhenUserIsNotNull() * Code clean up following cr
- Loading branch information