protected override Task Context() { _axisMapper = A.Fake <AxisMapper>(); _curveMapper = A.Fake <CurveMapper>(); _chartMapper = A.Fake <ChartMapper>(); _idGenerator = A.Fake <IIdGenerator>(); sut = new SimulationTimeProfileChartMapper(_chartMapper, _axisMapper, _curveMapper, _idGenerator); var dimensionFactory = A.Fake <IDimensionFactory>(); _curveChart = new SimulationTimeProfileChart { Name = "Chart", Description = "ChartDescription", Title = "Chart Title", OriginText = "Chart Origin Text", IncludeOriginData = true, PreviewSettings = true, }; _axis = new Axis(AxisTypes.X); _curveChart.AddAxis(_axis); _curve = new Curve(); var dataRepository = DomainHelperForSpecs.ObservedData(); var xColumn = dataRepository.BaseGrid; var yColumn = dataRepository.ObservationColumns().First(); _curve.SetxData(xColumn, dimensionFactory); _curve.SetyData(yColumn, dimensionFactory); _curveChart.AddCurve(_curve); _snapshotAxis = new Snapshots.Axis(); A.CallTo(() => _axisMapper.MapToSnapshot(_axis)).Returns(_snapshotAxis); _snapshotCurve = new Snapshots.Curve(); A.CallTo(() => _curveMapper.MapToSnapshot(_curve)).Returns(_snapshotCurve); return(_completed); }
public void SetAxisUI() { for (int i = 0; i < _input.axisInputs.Length; i++) { RectTransform InitialTrans = AxisInputSetting.GetComponent <RectTransform>(); float Padding = InitialTrans.rect.height + VerticalPadding; AxisMapper _axis = Instantiate(AxisInputSetting); _axis.transform.SetParent(transform, false); _axis.Title.text = _input.axisInputs[i].Name; _axis.KeyboardPositive.text = _input.axisInputs[i].Positive; _axis.KeyboardNegative.text = _input.axisInputs[i].Negative; _axis.GamepadName.text = _input.axisInputs[i].GamepadAxis; _axis.EditIndex = i; _axis.mapper = this; RectTransform AxisTrans = _axis.GetComponent <RectTransform>(); AxisTrans.anchoredPosition = InitialTrans.anchoredPosition - new Vector2(0, Padding * i); if (i + 1 >= _input.axisInputs.Length) { ButtonStartOffset = Padding * (i + 1); } } }