diff --git a/examples/Mailtrap.Example.Contact/Program.cs b/examples/Mailtrap.Example.Contact/Program.cs index 6cec63f5..d9ff80cb 100644 --- a/examples/Mailtrap.Example.Contact/Program.cs +++ b/examples/Mailtrap.Example.Contact/Program.cs @@ -32,7 +32,8 @@ IContactCollectionResource contactsResource = accountResource.Contacts(); // Get all contacts for account - IList contacts = await contactsResource.GetAll(); + // TODO: Enable when GetAll is implemented + IList contacts = /*await contactsResource.GetAll()*/ []; Contact? contact = contacts .FirstOrDefault(p => string.Equals(p.Email, contactEmail, StringComparison.OrdinalIgnoreCase)); diff --git a/examples/Mailtrap.Example.ContactEvents/Program.cs b/examples/Mailtrap.Example.ContactEvents/Program.cs index 4acda8fc..a8097fb4 100644 --- a/examples/Mailtrap.Example.ContactEvents/Program.cs +++ b/examples/Mailtrap.Example.ContactEvents/Program.cs @@ -33,7 +33,8 @@ IContactCollectionResource contactsResource = accountResource.Contacts(); // Get all contacts for account - IList contacts = await contactsResource.GetAll(); + // TODO: Enable when GetAll is implemented + IList contacts = /*await contactsResource.GetAll()*/ []; Contact? contact = contacts.Count > 0 ? contacts[0] : null; if (contact is null) diff --git a/src/Mailtrap.Abstractions/Contacts/IContactCollectionResource.cs b/src/Mailtrap.Abstractions/Contacts/IContactCollectionResource.cs index 196d6ad8..4003b183 100644 --- a/src/Mailtrap.Abstractions/Contacts/IContactCollectionResource.cs +++ b/src/Mailtrap.Abstractions/Contacts/IContactCollectionResource.cs @@ -96,19 +96,6 @@ public interface IContactCollectionResource : IRestResource /// public IContactEventCollectionResource Events(string contactId); - /// - /// Gets collection of contact details. - /// - /// - /// - /// Token to control operation cancellation. - /// - /// - /// - /// Collection of contact details. - /// - public Task> GetAll(CancellationToken cancellationToken = default); - /// /// Creates a new contact with details specified by . /// @@ -118,7 +105,7 @@ public interface IContactCollectionResource : IRestResource /// /// /// - /// + /// Token to control operation cancellation. /// /// /// diff --git a/tests/Mailtrap.IntegrationTests/Contacts/ContactsIntegrationTests.cs b/tests/Mailtrap.IntegrationTests/Contacts/ContactsIntegrationTests.cs index e85a41b6..9d8ccf5c 100644 --- a/tests/Mailtrap.IntegrationTests/Contacts/ContactsIntegrationTests.cs +++ b/tests/Mailtrap.IntegrationTests/Contacts/ContactsIntegrationTests.cs @@ -29,46 +29,46 @@ public ContactsIntegrationTests() _jsonSerializerOptions = _clientConfig.ToJsonSerializerOptions(); } - - [Test] - public async Task GetAll_Success() - { - // Arrange - var httpMethod = HttpMethod.Get; - var requestUri = _resourceUri.AbsoluteUri; - - using var responseContent = await Feature.LoadFileToStringContent(); - - using var mockHttp = new MockHttpMessageHandler(); - mockHttp - .Expect(httpMethod, requestUri) - .WithHeaders("Authorization", $"Bearer {_clientConfig.ApiToken}") - .WithHeaders("Accept", MimeTypes.Application.Json) - .WithHeaders("User-Agent", HeaderValues.UserAgent.ToString()) - .Respond(HttpStatusCode.OK, responseContent); - - var serviceCollection = new ServiceCollection(); - serviceCollection - .AddMailtrapClient(_clientConfig) - .ConfigurePrimaryHttpMessageHandler(() => mockHttp); - - using var services = serviceCollection.BuildServiceProvider(); - var client = services.GetRequiredService(); - - // Act - var result = await client - .Account(_accountId) - .Contacts() - .GetAll() - .ConfigureAwait(false); - - // Assert - mockHttp.VerifyNoOutstandingExpectation(); - - result.Should() - .NotBeNull().And - .HaveCount(3); - } + // TODO: Enable when GetAll is implemented + // [Test] + // public async Task GetAll_Success() + // { + // // Arrange + // var httpMethod = HttpMethod.Get; + // var requestUri = _resourceUri.AbsoluteUri; + + // using var responseContent = await Feature.LoadFileToStringContent(); + + // using var mockHttp = new MockHttpMessageHandler(); + // mockHttp + // .Expect(httpMethod, requestUri) + // .WithHeaders("Authorization", $"Bearer {_clientConfig.ApiToken}") + // .WithHeaders("Accept", MimeTypes.Application.Json) + // .WithHeaders("User-Agent", HeaderValues.UserAgent.ToString()) + // .Respond(HttpStatusCode.OK, responseContent); + + // var serviceCollection = new ServiceCollection(); + // serviceCollection + // .AddMailtrapClient(_clientConfig) + // .ConfigurePrimaryHttpMessageHandler(() => mockHttp); + + // using var services = serviceCollection.BuildServiceProvider(); + // var client = services.GetRequiredService(); + + // // Act + // var result = await client + // .Account(_accountId) + // .Contacts() + // .GetAll() + // .ConfigureAwait(false); + + // // Assert + // mockHttp.VerifyNoOutstandingExpectation(); + + // result.Should() + // .NotBeNull().And + // .HaveCount(3); + // } [Test] public async Task Create_Success()