/// <summary> /// Submits the specified <see cref="ActivityDataLog" /> as a new log record. /// </summary> /// <param name="dataLog">The <see cref="ActivityDataLog" />.</param> /// <returns><c>true</c> if submission was successful, <c>false</c> otherwise.</returns> /// <exception cref="ArgumentNullException"><paramref name="dataLog" /> is null.</exception> /// <exception cref="DataLoggerMockException">An issue with the data log was detected.</exception> public bool Submit(ActivityDataLog dataLog) { if (dataLog == null) { throw new ArgumentNullException(nameof(dataLog)); } if (Tables.ContainsKey(dataLog.TableName)) { Tables[dataLog.TableName].Add(dataLog); } else { DataLoggerMockTable newTable = new DataLoggerMockTable(dataLog); Tables.Add(dataLog.TableName, newTable); TableAdded?.Invoke(this, new DataLoggerMockTableEventArgs(newTable)); } return(true); }
///<summary>Raises the TableAdded event.</summary> ///<param name="e">A TableEventArgs object that provides the event data.</param> void OnTableAdded(TableEventArgs e) => TableAdded?.Invoke(this, e);
/// <summary> /// Initializes a new instance of the <see cref="DataLoggerMockInternal" /> class. /// </summary> public DataLoggerMockInternal() { _dataLoggerMock = new DataLoggerMock(); _dataLoggerMock.TableAdded += (s, e) => TableAdded?.Invoke(this, e); }