craigwardman / ChunkingRedisClient

A C# library which implements various wrappers around the StackExchange.Redis client, specifically using Newtonsoft.Json serialisation; Such as streamed reading/writing and sliding expiration.
MIT License
2 stars 1 forks source link

Reorganise the solution and start adding tests #4

Closed explorer14 closed 5 years ago

explorer14 commented 5 years ago

The goals with this PR are the following:

  1. Reorganise the solution into physical folders to make space for tests, and
  2. Start by adding the simplest tests first (more will be coming as I sneak in time on and off to work on this).

Additionally, this PR has also taken the liberty of converting the IRedisClientConfig interface into a class instead.

The reason for this are:

  1. There don't need to be multiple implementations of the config class itself because the only thing a developer needs to override is the connection string, for which they can always create a new instance with a different connection string value.

  2. The config class doesn't need to have any behaviour (atleast not any obvious ones at the minute) either, so let's YAGNI it.

  3. Testability doesn't particular benefit from it being an interface either, you just instantiate a new instance of it in tests.

I believe that abstractions should only be put in place when there is a real need for it. For e.g. IRedisReader is a fine abstraction to have that has multiple implementations with various serialisation types and writing strategies.

This could be potentially a breaking change but as of now, there have been zero downloads for v1.0.2 so I have bumped up the major version to make the difference a bit more visible.

image

explorer14 commented 5 years ago

Yo, I've made some of the changes you've requested and presented my thoughts on the others. Have a look and see if they make sense.