public void GetNameIdentifier_WhenCalledAndPrincipalHasNameIdentifierClaim_ReturnsNameIdentifier() { string nameIdentifier = _fixture.Create <string>(); IPrincipal principal = CreateClaimsPrincipal(new[] { new Claim(_fixture.Create <string>(), _fixture.Create <string>()), ClaimHelper.CreateNameIdentifierClaim(nameIdentifier) }); IClaimResolver sut = CreateSut(principal); string result = sut.GetNameIdentifier(); Assert.That(result, Is.EqualTo(nameIdentifier)); }