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