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

            mockHttp.Expect(HttpMethod.Get, Utils.GetSendGridApiUri(ENDPOINT, "suppressions")).Respond("application/json", ALL_SUPPRESSIONS_JSON);

            var client      = Utils.GetFluentClient(mockHttp);
            var suppresions = new Suppressions(client);

            // Act
            var result = await suppresions.GetAllAsync(CancellationToken.None).ConfigureAwait(false);

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