davezych / shience

A .NET port(ish) of Github's Scientist library. (https://github.com/github/scientist)
MIT License
9 stars 1 forks source link

Remove IPublisher and SetPublisher #23

Closed davezych closed 8 years ago

davezych commented 8 years ago

As mentioned in #10, IPublisher and the SetPublisher method aren't needed anymore. We will only support setting a publisher per-test, when calling New:

var science = Shience.New<bool>("test-name", (e) = { /*Do something with ExperimentResults } */);
MovGP0 commented 8 years ago

maybe we should put the file publisher into the Shience.Tests library, since the user is probably not needing it except for reference how to implement his own method.

davezych commented 8 years ago

Readded.

MovGP0 commented 8 years ago

I've re-implemented it as a .PublishTo(result => ...) extension method that allows for chaining in an local test branch. This way the user can choose to have multiple publish targets:

var result = Shience.New<bool>("somename")
   .Test(..., ...)
   .PublishTo(Log.Publish)
   .PublishTo(Console.Publish)
   .PublishTo(_ => ran = true)
   .Execute()
MovGP0 commented 8 years ago

The existing documentation got updated, but the new version still needs additional documentation and testing.