protected override void Context()
      {
         base.Context();
         sut.EditObservedData(_dataRepository);
         _dto = new CellValueChangedDTO {ColumnIndex = 0, OldDisplayValue = 1, NewDisplayValue = 2, RowIndex = 3};
         _command = A.Fake<ICommand>();

         A.CallTo(() => _dim.UnitValueToBaseUnitValue(A<Unit>._, 1)).Returns(10);
         A.CallTo(() => _dim.UnitValueToBaseUnitValue(A<Unit>._, 2)).Returns(20);
         A.CallTo(() => _editObservedDataTask.SetValue(A<DataRepository>._, A<CellValueChanged>._))
            .Invokes(x => _cellValueChanged = x.GetArgument<CellValueChanged>(1)).Returns(_command);
      }
        private CellValueChanged mapFrom(CellValueChangedDTO dto)
        {
            var columnId = GetColumnIdFromColumnIndex(dto.ColumnIndex);
            var column   = _observedData[columnId];

            return(new CellValueChanged
            {
                ColumnId = columnId,
                RowIndex = dto.RowIndex,
                OldValue = valueInBaseUnit(dto.OldDisplayValue, column),
                NewValue = valueInBaseUnit(dto.NewDisplayValue, column),
            });
        }
 public void ValueIsSet(CellValueChangedDTO cellValueChangedDTO)
 {
     this.DoWithinLatch(() => AddCommand(_editObservedDataTask.SetValue(_observedData, mapFrom(cellValueChangedDTO))));
 }