Extensions: Should we move ISystemClock to Primitives?

Created on 21 Sep 2016  路  7Comments  路  Source: dotnet/extensions

We use it as a way for testing and have copies of that interface in multiple places

I'm adding one to FileSystem to add testing support for polling. Should we commonize it Microsoft.Extensions.Primitives? That said, it's not a whole lot of code to replicate so there isn't a lot of benefit to commonizing it.

Won't Fix

Most helpful comment

Real world apps (see where I am looking at) need this abstraction. But because it's not in Primitives we'll have to do our own, like we did by the past.
Sad thing is that now there is a risk that some of the components in the application don't use the same abstraction and make some tests not possible.

All 7 comments

cc @Tratcher \ @Eilon

_shrug_ we keep talking about it but never found a reason to do it.

Meh. It's so tiny we'd just be adding more spaghetti.

The clock interface is always testing purposes. IMO unless we need different clock implementations at runtime, it doesn't provide value as an API.

Yeah it's always just for testing. And it's like 10 lines of code. And it never changes.

Real world apps (see where I am looking at) need this abstraction. But because it's not in Primitives we'll have to do our own, like we did by the past.
Sad thing is that now there is a risk that some of the components in the application don't use the same abstraction and make some tests not possible.

I would like this abstraction as well

Was this page helpful?
0 / 5 - 0 ratings

Related issues

poppastring picture poppastring  路  4Comments

vsfeedback picture vsfeedback  路  6Comments

vanbukin picture vanbukin  路  7Comments

pstricks-fans picture pstricks-fans  路  3Comments

christiannagel picture christiannagel  路  4Comments