static SamplingMethodsImplementations() { AggregationImplementations <SamplingImplementationBase> .RegisterAggregationImplementation("dayofweek", new DayOfWeekSampling()); AggregationImplementations <SamplingImplementationBase> .RegisterAggregationImplementation("round", new RoundSampling()); AggregationImplementations <SamplingImplementationBase> .RegisterAggregationImplementation("hourofday", new HourOfDaySampling()); }
public void RegisterImplementation() { "dayofweek is registered".Given( () => { AggregationImplementations <SamplingImplementationBase> .RegisterAggregationImplementation( "dayofweek", new DayOfWeekSampling()); }); "when looking for the implementation".When( () => AggregationImplementations <SamplingImplementationBase> .GetAggregationImplementation("dayofweek") .Should() .NotBeNull()); }
public void LookForUnregisteredImplementation() { Exception exception = null; "dayofweek is registered".Given( () => { AggregationImplementations <SamplingImplementationBase> .RegisterAggregationImplementation( "dayofweek", new DayOfWeekSampling()); }); "when looking for the implementation".When( () => exception = Record.Exception(() => AggregationImplementations <SamplingImplementationBase> .GetAggregationImplementation("xxx"))); "unsupported Exception is thrown".Then(() => exception.Should().BeOfType <NotSupportedException>()); }