Skip to content

Commit a604308

Browse files
committed
implement IFacturapiClient interface for improved testing support
1 parent 97c40b5 commit a604308

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [5.0.0] - Unreleased
8+
## [5.0.0] - 2025-12-10
99

1010
### Breaking
1111

@@ -14,10 +14,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
### Added
1515

1616
- `FacturapiException.Status` now surfaces the HTTP status code when available.
17+
- Introduced `IFacturapiClient` so consumers can mock the client surface in tests.
1718

1819
### Changed
1920

20-
- `FacturapiClient` now implements `IDisposable`; dispose it when finished to release HTTP resources. If not disposed, garbage collection will eventually clean up, but explicit disposal avoids lingering HTTP connections.
21+
- `FacturapiClient` now implements `IDisposable`; call `Dispose()` when finished (or wrap in `using`) to release HTTP resources. If not disposed, garbage collection will eventually clean up, but explicit disposal avoids lingering HTTP connections.
2122

2223
## [4.11.0] - 2025-12-10
2324

FacturapiClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace Facturapi
77
{
8-
public class FacturapiClient : IDisposable
8+
public class FacturapiClient : IFacturapiClient
99
{
1010
public Wrappers.CustomerWrapper Customer { get; private set; }
1111
public Wrappers.ProductWrapper Product { get; private set; }

IFacturapiClient.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using Facturapi.Wrappers;
2+
using System;
3+
4+
namespace Facturapi
5+
{
6+
public interface IFacturapiClient : IDisposable
7+
{
8+
CustomerWrapper Customer { get; }
9+
ProductWrapper Product { get; }
10+
InvoiceWrapper Invoice { get; }
11+
OrganizationWrapper Organization { get; }
12+
ReceiptWrapper Receipt { get; }
13+
RetentionWrapper Retention { get; }
14+
CatalogWrapper Catalog { get; }
15+
CatalogWrapper CartaporteCatalog { get; }
16+
ToolWrapper Tool { get; }
17+
}
18+
}

0 commit comments

Comments
 (0)