Пример #1
0
        static SamplingMethodsImplementations()
        {
            AggregationImplementations <SamplingImplementationBase> .RegisterAggregationImplementation("dayofweek", new DayOfWeekSampling());

            AggregationImplementations <SamplingImplementationBase> .RegisterAggregationImplementation("round", new RoundSampling());

            AggregationImplementations <SamplingImplementationBase> .RegisterAggregationImplementation("hourofday", new HourOfDaySampling());
        }
Пример #2
0
        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());
        }
Пример #3
0
        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>());
        }