예제 #1
0
        public void InncorrectUsername()
        {
            var provider = new CookieAuthorizationDataProvider(null);

            var claim = new Claim("TestType", "TestValue");

            var httpContext = new HttpContextBuilder().Build();

            provider.AddClaim(claim, httpContext, "*****@*****.**");

            var claims = provider.GetClaims(httpContext, "*****@*****.**");

            claims.Length.Should().Be(0);
        }
예제 #2
0
        public void GetClaim()
        {
            var provider = new CookieAuthorizationDataProvider(null);

            var claim = new Claim("TestType", "TestValue");

            var httpContext = new HttpContextBuilder().Build();

            provider.AddClaim(claim, httpContext, "*****@*****.**");

            var claims = provider.GetClaims(httpContext, "*****@*****.**");

            claims.Length.Should().Be(1);
            claims[0].Type.Should().Be("TestType");
            claims[0].Value.Should().Be("TestValue");
        }