Пример #1
0
        public async void CreateInProductTrainingViewReturnsForbiddenWhenPermissionIsDenied()
        {
            PolicyEvaluatorMock
            .Setup(x => x.EvaluateAsync(It.IsAny <PolicyEvaluationContext>(), It.IsAny <CancellationToken>()))
            .ReturnsAsync(PermissionScope.Deny);

            var actual = await UserTokenBrowser.Post("/v1/inproducttraining/viewed", BuildRequest);

            Assert.Equal(HttpStatusCode.Forbidden, actual.StatusCode);
        }
Пример #2
0
        public async void GetWizardViewsReturnsForbiddenWhenPermissionIsDenied()
        {
            PolicyEvaluatorMock
            .Setup(x => x.EvaluateAsync(It.IsAny <PolicyEvaluationContext>(), It.IsAny <CancellationToken>()))
            .ReturnsAsync(PermissionScope.Deny);

            var actual = await UserTokenBrowser.Get($"/v1/wizards/viewed/{_defaultUserId}", BuildRequest);

            Assert.Equal(HttpStatusCode.Forbidden, actual.StatusCode);
        }