GetAllContacts() 공개 메소드

public GetAllContacts ( string count = "", string property = "", string contactOffset = "" ) : System.Json.JsonObject
count string
property string
contactOffset string
리턴 System.Json.JsonObject
예제 #1
0
        public void ContactsGetAllContactsUrlFormedCorrectly()
        {
            var mockDataSource = MockRepository.GenerateMock<IWebClient>();
            string expectedUrl = Constants.GetAllContactsUrl;

            // Arrange
            mockDataSource
                .Stub(x => x.UploadString(
                    Arg<string>.Is.Anything, // uri
                    Arg<string>.Is.Anything, // method
                    Arg<string>.Is.Anything, // content-type
                    Arg<string>.Is.Anything  // data
                               ))
                .Return(string.Empty);

            // Act
            var target = new Contacts(apiKey: Constants.ApiKey)
            {
                UserWebClient = mockDataSource
            };
            target.GetAllContacts();

            // Assert
            mockDataSource.AssertWasCalled(c => c.UploadString(
                uri: Arg<string>.Matches(actualUrl => actualUrl == expectedUrl),
                method: Arg<string>.Is.Anything,
                contentType: Arg<string>.Is.Anything,
                data: Arg<string>.Is.Anything));
        }