Пример #1
0
        public async Task GivenNullRequest_WhenHandlingRequest_ThenThrowArgumentNullException()
        {
            IAuthorizationService <DataActions> authService = Substitute.For <IAuthorizationService <DataActions> >();
            IAddExtendedQueryTagService         tagService  = Substitute.For <IAddExtendedQueryTagService>();
            var handler = new AddExtendedQueryTagHandler(authService, tagService);

            await Assert.ThrowsAsync <ArgumentNullException>(() => handler.Handle(null, default));

            await authService.DidNotReceiveWithAnyArgs().CheckAccess(default, default);
Пример #2
0
 public AddExtendedQueryTagHandler(IAuthorizationService <DataActions> authorizationService, IAddExtendedQueryTagService addExtendedQueryTagService)
     : base(authorizationService)
 {
     EnsureArg.IsNotNull(addExtendedQueryTagService, nameof(addExtendedQueryTagService));
     _addExtendedQueryTagService = addExtendedQueryTagService;
 }
Пример #3
0
 public AddExtendedQueryTagServiceTests()
 {
     _extendedQueryTagEntryValidator = Substitute.For <IExtendedQueryTagEntryValidator>();
     _extendedQueryTagStore          = Substitute.For <IExtendedQueryTagStore>();
     _extendedQueryTagService        = new AddExtendedQueryTagService(_extendedQueryTagStore, _extendedQueryTagEntryValidator);
 }