Beispiel #1
0
        public void CreateUserBinding_should_send_a_post_to_api_v2_user_bindings()
        {
            //given
            var userBinding = new UserBindingRequest()
            {
                TruCodeId      = System.Guid.NewGuid().ToString(),
                UserIdentifier = "taco123"
            };

            SetupMock(statusCode: HttpStatusCode.NoContent);

            //when
            sut.CreateUserBinding(userBinding);

            //then
            MockHttpClient.Verify(x => x.HandleRequest(
                                      It.Is <HttpRequestMessage>(req =>
                                                                 req.Method == HttpMethod.Post &&
                                                                 req.RequestUri == new System.Uri("https://jones.net/api/v2/user_bindings")
                                                                 //&& req.Content.ToString().Contains(userBinding.TruCodeId.ToString())
                                                                 ),
                                      It.IsAny <ApiCredentials>()
                                      ), Times.Exactly(1));
        }