Ejemplo n.º 1
0
        public async Task GetUnassignedAsync()
        {
            // Arrange
            var mockHttp = new MockHttpMessageHandler();

            mockHttp.Expect(HttpMethod.Get, Utils.GetSendGridApiUri(ENDPOINT) + $"?exclude_whitelabels=false&limit=500&offset=0&sort_by_direction=asc").Respond("application/json", MULTIPLE_IPADDRESSES_JSON);

            var client      = Utils.GetFluentClient(mockHttp);
            var ipAddresses = new IpAddresses(client);

            // Act
            var result = await ipAddresses.GetUnassignedAsync(CancellationToken.None).ConfigureAwait(false);

            // Assert
            mockHttp.VerifyNoOutstandingExpectation();
            mockHttp.VerifyNoOutstandingRequest();
            result.ShouldNotBeNull();
            result.Length.ShouldBe(1);
        }