protected override Task Context()
        {
            _parameterMapper       = A.Fake <ParameterMapper>();
            _outputIntervalFactory = A.Fake <IOutputIntervalFactory>();
            sut = new OutputIntervalMapper(_parameterMapper, _outputIntervalFactory);

            _outputInterval = new OutputInterval
            {
                Name = "Interval"
            };
            _endTimeParameter    = DomainHelperForSpecs.ConstantParameterWithValue(1, isDefault: true).WithName(Constants.Parameters.END_TIME);
            _resolutionParameter = DomainHelperForSpecs.ConstantParameterWithValue(1, isDefault: true).WithName(Constants.Parameters.RESOLUTION);
            _anotherParameter    = DomainHelperForSpecs.ConstantParameterWithValue(1, isDefault: false).WithName("Another");
            _outputInterval.Add(_endTimeParameter);
            _outputInterval.Add(_anotherParameter);
            _outputInterval.Add(_resolutionParameter);

            _endTimeSnapshotParameter    = new Parameter().WithName(_endTimeParameter.Name);
            _anotherSnapshotParameter    = new Parameter().WithName(_anotherParameter.Name);
            _resolutionSnapshotParameter = new Parameter().WithName(_resolutionParameter.Name);
            A.CallTo(() => _parameterMapper.MapToSnapshot(_endTimeParameter)).Returns(_endTimeSnapshotParameter);
            A.CallTo(() => _parameterMapper.MapToSnapshot(_anotherParameter)).Returns(_anotherSnapshotParameter);
            A.CallTo(() => _parameterMapper.MapToSnapshot(_resolutionParameter)).Returns(_resolutionSnapshotParameter);

            return(_completed);
        }
Esempio n. 2
0
 public OutputIntervalMapper(ParameterMapper parameterMapper, IOutputIntervalFactory outputIntervalFactory) : base(parameterMapper)
 {
     _outputIntervalFactory = outputIntervalFactory;
 }