public void Log131DataAdapter_AddToStore_With_Data_Updates_DataRowCount()
        {
            AddParents();

            // Add 10 rows of data
            const int dataRowCount = 10;

            // Add a Log with dataRowCount Rows
            DevKit.AddLogWithData(Log, LogIndexType.measureddepth, dataRowCount, false);

            DevKit.GetAndAssertDataRowCount(DevKit.CreateLog(Log), dataRowCount);
        }
Beispiel #2
0
        private void GetAndAssertByDataRowCount(int totalAddRows, int lessRows, int expectedRows)
        {
            AddParents();

            // Add a Log with dataRowCount Rows
            DevKit.AddLogWithData(Log, LogIndexType.measureddepth, totalAddRows, false);

            var queryLog = DevKit.CreateLog(Log);

            DevKit.GetAndAssertDataRowCount(queryLog, totalAddRows);

            // Retrieve less than dataRowCount rows
            queryLog.DataRowCount = totalAddRows - lessRows;
            DevKit.GetAndAssertDataRowCountExpected(queryLog, expectedRows);
        }
        public void Log131DataAdapter_UpdateInStore_With_New_Row_Updates_DataRowCount()
        {
            AddParents();

            // Add a Log with dataRowCount Rows
            const int dataRowCount = 10;

            DevKit.AddLogWithData(Log, LogIndexType.measureddepth, dataRowCount, false);

            // Create an Update log with totalUpdateRows
            const int totalUpdateRows = 1;
            var       updateLog       = DevKit.CreateUpdateLogWithRows(Log, totalUpdateRows);

            // Update the Log with a new Row
            DevKit.UpdateAndAssert(updateLog);

            DevKit.GetAndAssertDataRowCount(DevKit.CreateLog(Log), dataRowCount + totalUpdateRows);
        }
        private void DeleteAndAssertDataRowCount(int rowsToAdd, int deleteIndex, int expectedDataRowCount)
        {
            AddParents();

            // Add a Log with dataRowCount Rows
            DevKit.AddLogWithData(Log, LogIndexType.measureddepth, rowsToAdd, false);

            // Assert that the dataRowCount is equivalent with the AddToStore
            DevKit.GetAndAssertDataRowCount(DevKit.CreateLog(Log), rowsToAdd);

            // Create a deleteLog that deletes one row
            var deleteLog = DevKit.CreateLog(Log);

            deleteLog.StartIndex = new GenericMeasure(deleteIndex, Log.LogCurveInfo[0].Unit);
            deleteLog.EndIndex   = new GenericMeasure(deleteIndex, Log.LogCurveInfo[0].Unit);

            // Update the Log with a new Row
            DevKit.DeleteAndAssert(deleteLog, partialDelete: true);

            DevKit.GetAndAssertDataRowCount(DevKit.CreateLog(Log), expectedDataRowCount);
        }
Beispiel #5
0
        public void Log131DataAdapter_GetFromStore_With_RequestLatestValues()
        {
            const int totalAddRows = 10;
            const int expectedRows = 5;

            AddParents();

            // Add a Log with dataRowCount Rows
            DevKit.AddLogWithData(Log, LogIndexType.measureddepth, totalAddRows, false);

            var queryLog = DevKit.CreateLog(Log);

            // Get the log
            var optionsIn = $"{OptionsIn.ReturnElements.RequestLatestValues.Eq(expectedRows)};{OptionsIn.ReturnElements.All}";
            var result    = DevKit.GetAndAssert <LogList, Log>(queryLog, optionsIn: optionsIn);

            // Assert that the DataRowCount is the same as the number of rows added.
            Assert.AreEqual(expectedRows, result.LogData.Count);

            // Last rows are equal
            Assert.AreEqual(Log.LogData[Log.LogData.Count - 1], result.LogData[result.LogData.Count - 1]);
        }
        public void Log131DataAdapter_UpdateInStore_Updates_Existing_Row_Does_Not_Change_DataRowCount()
        {
            AddParents();

            // Add a Log with dataRowCount Rows
            const int dataRowCount = 10;

            DevKit.AddLogWithData(Log, LogIndexType.measureddepth, dataRowCount, false);

            // Create an Update log that updates the last row of LogData
            var updateLog = DevKit.CreateLog(Log);

            updateLog.LogCurveInfo = Log.LogCurveInfo;
            updateLog.LogData      = new List <string> {
                Log.LogData[Log.LogData.Count - 1]
            };

            // Update the Log with a new Row
            DevKit.UpdateAndAssert(updateLog);

            DevKit.GetAndAssertDataRowCount(DevKit.CreateLog(Log), dataRowCount);
        }