vcdiff icon indicating copy to clipboard operation
vcdiff copied to clipboard

Provide abstractions for public API

Open Matthiee opened this issue 3 years ago • 3 comments

It would be nice to have an abstraction layer so that consumers of this library can mock out instances of the library in unit tests!

Matthiee avatar May 03 '21 14:05 Matthiee

Hi,

Not sure what you mean an abstraction layer, what type of meaningful abstractions would you like to see?

chyyran avatar May 03 '21 14:05 chyyran

Hi

I mean something like this:

public interface IVcEncoder : IDisposable
{
    VCDiffResult Encode();
    Task<VCDiffResult> EncodeAsync();
}

Matthiee avatar May 03 '21 15:05 Matthiee

I am not sure this will be very useful but I'll look into extracting interfaces out for VcEncoder and VcDecoder, although in general I'm not sure it's a good idea to mock out library code in a client test.

On Mon., May 3, 2021, 11:12 a.m. Matthias Beerens, @.***> wrote:

Hi

I mean something like this:

public interface IVcEncoder : IDisposable { VCDiffResult Encode(); Task<VCDiffResult> EncodeAsync(); }

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SnowflakePowered/vcdiff/issues/5#issuecomment-831325207, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHUINZ3EIXYQ4R4XGGWDZTTL24PDANCNFSM44A6M3CQ .

chyyran avatar May 03 '21 15:05 chyyran