public void InitialMatchTestWhereB2CObjectNotExists()
        {
            _b2cobjectId = "5A90DD44-DD9B-E811-A94F-000D3A3A8543";
            var client = new RestClient(URL);
            // var key = ApplicationAuthenticator.GetS2SAccessTokenForProdMSAAsync();
            var request = new RestRequest("InitialMatch?B2CObjectId=" + _b2cobjectId, Method.GET)
            {
                RequestFormat = DataFormat.Json
            };

            var response = client.Get(request);

            Thread.Sleep(1000);
            if (!string.IsNullOrEmpty(response.Content))
            {
                InitialMatchResponse returnValue = JsonConvert.DeserializeObject <InitialMatchResponse>(response.Content);
                Assert.AreEqual(204, returnValue.ErrorCode);
                Assert.AreEqual("No Content", returnValue.ErrorMsg);
            }
        }
        public void InitialMatchTestWithInValidInput()
        {
            _b2cobjectId = "7b1ad2d0-7946-11e8-8d36-851e870eee8";
            var client = new RestClient(URL);
            // var key = ApplicationAuthenticator.GetS2SAccessTokenForProdMSAAsync();
            var request = new RestRequest("InitialMatch?B2CObjectId=" + _b2cobjectId, Method.GET)
            {
                RequestFormat = DataFormat.Json
            };

            var response = client.Get(request);

            Thread.Sleep(1000);
            if (!string.IsNullOrEmpty(response.Content))
            {
                InitialMatchResponse returnValue = JsonConvert.DeserializeObject <InitialMatchResponse>(response.Content);
                Assert.AreEqual(400, returnValue.ErrorCode);
                Assert.AreEqual("B2CObjectid is invalid, is not a valid Guid.", returnValue.ErrorMsg);
            }
        }
        public void InitialMatchTestWithMissingSecurityWordSetFalse()
        {
            _b2cobjectId = "333e5d21-54b7-44d8-940b-de6a65ac0310";
            var client = new RestClient(URL);
            // var key = ApplicationAuthenticator.GetS2SAccessTokenForProdMSAAsync();
            var request = new RestRequest("InitialMatch?B2CObjectId=" + _b2cobjectId, Method.GET)
            {
                RequestFormat = DataFormat.Json
            };

            var response = client.Get(request);

            Thread.Sleep(1000);
            if (!string.IsNullOrEmpty(response.Content))
            {
                InitialMatchResponse returnValue = JsonConvert.DeserializeObject <InitialMatchResponse>(response.Content);
                Assert.IsNotNull(returnValue.ServiceUserID);
                Assert.IsFalse(returnValue.securityWordSet);
                Assert.AreEqual(200, returnValue.ErrorCode);
            }
        }
示例#4
0
        public void InitialMatchTestWithValidInput()
        {
            var client = new RestClient(URL);
            // var key = ApplicationAuthenticator.GetS2SAccessTokenForProdMSAAsync();
            var request = new RestRequest("InitialMatch?" + _b2cobjectId, Method.GET)
            {
                RequestFormat = DataFormat.Json
            };


            var response = client.Get(request);

            Thread.Sleep(1000);
            if (!string.IsNullOrEmpty(response.Content))
            {
                InitialMatchResponse returnValue = JsonConvert.DeserializeObject <InitialMatchResponse>(response.Content);
                Assert.IsNotNull(returnValue.ServiceUserID);
                Assert.AreEqual(CONTACTID, returnValue.ServiceUserID);
                Assert.AreEqual(200, returnValue.ErrorCode);
            }
        }