FreeRedis
FreeRedis copied to clipboard
Create mock RedisClient for testing purpose.
Since RedisClient does not have a proper interface, so if i want to write a mock RedisClient ( for unit testing), i have to inherit RedisClient class. But it seem be hard since it's method is not abtract or virtual method. Is there anyway to do it ?.
Because there are so many methods and each method only executes simple commands, there is no interface defined.
You can establish your own interface and call redisclient in the implementation part. It is also convenient to replace components in the future.
That mean I have to add an extra class ( and interface) to wrap RedisClient. Look into the code, I see another way: I could create a new Adapter implementation ( since RedisClient methods is actual calling Adapter.Call). You have it (interface) in your other work ( FreeSQL). It is a nice library. So hope to see it in the future in FreeRedis too 😃.
I have work done by using Visual studio refactor. If you have time, take a look: #91
Thank you for your dedication. The interface method needs to improve the code summary
v0.5.1