public async Task GetBasicInformationAsync_EmptyObjectName_ThrowsException()
        {
            var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK) {Content = new JsonContent(new {})};
            var httpClient = new HttpClient(new FakeHttpRequestHandler(expectedResponse));
            var forceClient = new ForceClient("http://localhost:1899", "accessToken", ApiVersion, httpClient);

            Action<ArgumentNullException> asserts = exception => Assert.That(exception.Message, Is.Not.Null);
            await AssertEx.ThrowsAsync(() => forceClient.BasicInformationAsync<object>(""), asserts);
        }
        public async void GetBasicInformationAsync_EmptyObjectName_ThrowsException()
        {
            var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK) {Content = new JsonContent(new {})};
            var httpClient = new HttpClient(new FakeHttpRequestHandler(expectedResponse));
            var forceClient = new ForceClient("http://localhost:1899", "accessToken", "v29", httpClient);

            await forceClient.BasicInformationAsync<object>("");

            // expects exception
        }
Exemple #3
0
        public async Task GetBasicInformationAsync_EmptyObjectName_ThrowsException()
        {
            var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new JsonContent(new { })
            };
            var httpClient  = new HttpClient(new FakeHttpRequestHandler(expectedResponse));
            var forceClient = new ForceClient("http://localhost:1899", "accessToken", ApiVersion, httpClient, new HttpClient());

            Action <ArgumentNullException> asserts = exception => Assert.IsNotNull(exception.Message);
            await AssertEx.ThrowsAsync(() => forceClient.BasicInformationAsync <object>(""), asserts);
        }
Exemple #4
0
        public async void GetBasicInformationAsync_EmptyObjectName_ThrowsException()
        {
            var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK);

            expectedResponse.Content = new JsonContent(new { });
            var httpClient  = new HttpClient(new FakeHttpRequestHandler(expectedResponse));
            var forceClient = new ForceClient("http://localhost:1899", "accessToken", "v29", httpClient);

            var result = await forceClient.BasicInformationAsync <object>("");

            // expects exception
        }
Exemple #5
0
        public async void GetBasicInformationAsync_ValidObjectName_ReturnsParsedResponse()
        {
            var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = JsonContent.FromFile("KnownGoodContent/UserObjectDescribeMetadata.json")
            };
            var httpClient  = new HttpClient(new FakeHttpRequestHandler(expectedResponse));
            var forceClient = new ForceClient("http://localhost:1899", "accessToken", ApiVersion, httpClient, new HttpClient());

            var result = await forceClient.BasicInformationAsync <ObjectDescribeMetadata>("ValidObjectName");

            Assert.IsNotNull(result.Name);
            Assert.AreEqual("User", result.Name);
        }
        public async void GetBasicInformationAsync_ValidObjectName_ReturnsParsedResponse()
        {
            var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = JsonContent.FromFile("KnownGoodContent/UserObjectDescribeMetadata.json")
            };
            var httpClient = new HttpClient(new FakeHttpRequestHandler(expectedResponse));
            var forceClient = new ForceClient("http://localhost:1899", "accessToken", "v29", httpClient);

            var result = await forceClient.BasicInformationAsync<ObjectDescribeMetadata>("ValidObjectName");

            Assert.IsNotNullOrEmpty(result.Name);
            Assert.AreEqual("User", result.Name);
        }
Exemple #7
0
        public async Task Object_BasicInformation_IsNotNull()
        {
            var accounts = await _client.BasicInformationAsync <object>("Account");

            Assert.IsNotNull(accounts);
        }