private WitsmlLogs GetLogs(string indexType, Index startIndex, Index endIndex)
        {
            var witsmlLog = new WitsmlLog
            {
                UidWell     = WellUid,
                UidWellbore = WellboreUid,
                Uid         = LogUid,
                IndexType   = indexType
            };

            switch (indexType)
            {
            case WitsmlLog.WITSML_INDEX_TYPE_MD:
                witsmlLog.StartIndex = new WitsmlIndex((DepthIndex)startIndex);
                witsmlLog.EndIndex   = new WitsmlIndex((DepthIndex)endIndex);
                break;

            case WitsmlLog.WITSML_INDEX_TYPE_DATE_TIME:
                witsmlLog.StartDateTimeIndex = startIndex.GetValueAsString();
                witsmlLog.EndDateTimeIndex   = endIndex.GetValueAsString();
                break;
            }

            return(new WitsmlLogs
            {
                Logs = new List <WitsmlLog> {
                    witsmlLog
                }
            });
        }
        private void SetupLog(string indexType, Index startIndex, Index endIndex)
        {
            witsmlClient.Setup(client =>
                               client.GetFromStoreAsync(It.Is <WitsmlLogs>(witsmlLogs => witsmlLogs.Logs.First().Uid == LogUid), OptionsIn.HeaderOnly))
            .ReturnsAsync(GetLogs(indexType, startIndex, endIndex));

            witsmlClient.Setup(client =>
                               client.GetFromStoreAsync(It.Is <WitsmlLogs>(witsmlLogs => witsmlLogs.Logs.First().Uid != LogUid), OptionsIn.HeaderOnly))
            .ReturnsAsync(new WitsmlLogs());

            witsmlClient.Setup(client =>
                               client.DeleteFromStoreAsync(It.Is <WitsmlLogs>(witsmlLogs => witsmlLogs.Logs.First().Uid == LogUid)))
            .ReturnsAsync(new QueryResult(true, null));
        }
Exemple #3
0
 private void SetupLog(string indexType, Index startIndex, Index endIndex)
 {
     witsmlClient.Setup(client =>
                        client.GetFromStoreAsync(It.Is <WitsmlLogs>(witsmlLogs => witsmlLogs.Logs.First().Uid == LogUid), new OptionsIn(ReturnElements.HeaderOnly, null)))
     .ReturnsAsync(GetLogs(indexType, startIndex, endIndex));
 }