Exemplo n.º 1
0
        public void ResponseAlternateTypeUriTests()
        {
            var request = new ClaimsRequest(Constants.TypeUris.Variant10);

            request.Email = DemandLevel.Require;

            var response = new ClaimsResponse(Constants.TypeUris.Variant10);

            response.Email = "*****@*****.**";

            ExtensionTestUtilities.Roundtrip(Protocol.Default, new[] { request }, new[] { response });
        }
Exemplo n.º 2
0
        public void Fetch()
        {
            var request = new FetchRequest();

            request.Attributes.Add(new AttributeRequest(NicknameTypeUri));
            request.Attributes.Add(new AttributeRequest(EmailTypeUri, false, int.MaxValue));

            var response = new FetchResponse();

            response.Attributes.Add(new AttributeValues(NicknameTypeUri, "Andrew"));
            response.Attributes.Add(new AttributeValues(EmailTypeUri, "*****@*****.**", "*****@*****.**"));

            ExtensionTestUtilities.Roundtrip(Protocol.Default, new[] { request }, new[] { response });
        }
Exemplo n.º 3
0
        public void Store()
        {
            var request      = new StoreRequest();
            var newAttribute = new AttributeValues(
                IncrementingAttribute,
                "val" + (this.incrementingAttributeValue++).ToString(),
                "val" + (this.incrementingAttributeValue++).ToString());

            request.Attributes.Add(newAttribute);

            var successResponse = new StoreResponse();

            successResponse.Succeeded = true;

            ExtensionTestUtilities.Roundtrip(Protocol.Default, new[] { request }, new[] { successResponse });

            var failureResponse = new StoreResponse();

            failureResponse.Succeeded     = false;
            failureResponse.FailureReason = "Some error";

            ExtensionTestUtilities.Roundtrip(Protocol.Default, new[] { request }, new[] { failureResponse });
        }