示例#1
0
        public void Log141Adapter_DeleteFromStore_Can_Delete_Log_With_Data()
        {
            const int numOfRows = 10;

            // Add log
            AddParents();

            _devKit.InitHeader(_log, LogIndexType.measureddepth);
            _devKit.InitDataMany(_log, _devKit.Mnemonics(_log), _devKit.Units(_log), numOfRows);

            AddLog(_log);

            // Query log
            var result   = GetLog(_log);
            var logDatas = result.LogData;

            Assert.IsNotNull(logDatas);
            var logData = logDatas.FirstOrDefault();

            Assert.IsNotNull(logData);
            Assert.AreEqual(numOfRows, logData.Data.Count);

            // Delete log
            DeleteLog(_log, string.Empty);

            // Assert log is deleted
            var query   = _devKit.CreateLog(_log.Uid, null, _log.UidWell, null, _log.UidWellbore, null);
            var results = _devKit.Query <LogList, Log>(query, optionsIn: OptionsIn.ReturnElements.All);

            Assert.AreEqual(0, results.Count);

            var uri = _log.GetUri();

            // Assert Channel Data Chunk is deleted
            var chunks = GetDataChunks(uri);

            Assert.IsTrue(chunks.Count == 0);
        }
示例#2
0
        public void WITSMLWebServiceConnection_Can_Write_And_Query_Log_Data()
        {
            // Add Well
            _devKit.Proxy.Write(_devKit.New <WellList>(x => x.Well = _devKit.List(_well1)));

            // Add Wellbore
            _devKit.Proxy.Write(_devKit.New <WellboreList>(x => x.Wellbore = _devKit.List(_wellbore1)));

            // Add Log header
            _devKit.Proxy.Write(_devKit.New <LogList>(x => x.Log = _devKit.List(_log1)));

            // Update Log with new LogData
            var log1 = new Log()
            {
                Uid = _log1.Uid, UidWell = _log1.UidWell, UidWellbore = _log1.UidWellbore
            };

            _devKit.InitData(log1, _devKit.Mnemonics(_log1), _devKit.Units(_log1), 0, null, 0);
            _devKit.Proxy.Update(_devKit.New <LogList>(x => x.Log = _devKit.List(log1)));

            // Get Log by Uid
            var query = _devKit.Query <LogList>();

            query.Log = _devKit.One <Log>(x => { x.Uid = _log1.Uid; x.UidWell = _log1.UidWell; x.UidWellbore = _log1.UidWellbore; });

            var result = _devKit.Proxy.Read(query, OptionsIn.ReturnElements.All);

            Assert.IsNotNull(result.Log);
            Assert.AreEqual(1, result.Log.Count);
            Assert.IsNotNull(result.Log.SingleOrDefault(x => x.Uid == _log1.Uid));

            Assert.IsNotNull(result.Log[0].LogData);
            Assert.AreEqual(1, result.Log[0].LogData.Count);

            Assert.IsNotNull(result.Log[0].LogData[0].Data);
            Assert.AreEqual(1, result.Log[0].LogData[0].Data.Count);
            Assert.AreEqual("0,0", result.Log[0].LogData[0].Data[0]);
        }