Beispiel #1
0
        public void BypassUserRole_WithNullOrEmptyRole_ShouldThrow(string userRole, Type expectedException)
        {
            MiddlewareOptionsBuilder builder = new MiddlewareOptionsBuilder(_dirMapperSvc);
            Action testAction = () =>
            {
                builder.BypassUserRole(userRole);
            };

            testAction.ShouldThrow(expectedException);
        }
Beispiel #2
0
        public void BypassUserRole_WithRole_ValueShouldBeEqualToTheInput()
        {
            const string             userRole = "role1";
            MiddlewareOptionsBuilder builder  = new MiddlewareOptionsBuilder(_dirMapperSvc);

            builder.BypassUserRole(userRole);

            BypassUserRoleOption option = builder.GetOptions()
                                          .GetSingleOrDefault <BypassUserRoleOption>();

            option
            .ShouldNotBeNull()
            .Value.ShouldBe(userRole);
        }