示例#1
0
        public void GetTenantIdShouldReturnTenantId()
        {
            ClaimsPrincipal principal = new ClaimsPrincipal(
                new ClaimsIdentity(
                        new[]
                        {
                            new Claim(AllReady.Security.ClaimTypes.Tenant, "12")
                        }
                    ));

            Assert.Equal(12, principal.GetTenantId());
        }
示例#2
0
        public void GetTenantIdShouldReturnNullWhenNotAnInteger()
        {
            ClaimsPrincipal principal = new ClaimsPrincipal(
                new ClaimsIdentity(
                        new[]
                        {
                            new Claim(AllReady.Security.ClaimTypes.Tenant, "ThisIsWRong")
                        }
                    ));

            Assert.Null(principal.GetTenantId());
        }