예제 #1
0
        public void WITSMLWebServiceConnection_Can_Query_Log_Data_By_StartIndex_EndIndex()
        {
            // 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.InitDataMany(log1, _devKit.Mnemonics(_log1), _devKit.Units(_log1), 10);
            _devKit.Proxy.Update(_devKit.New <LogList>(x => x.Log = _devKit.List(log1)));


            // StartIndex and End Index above range
            LogList result = _devKit.QueryLogByRange(log1, -2, -1);

            Assert.AreEqual(0, result.Log.Count);

            // EndIndex on start of range
            result = _devKit.QueryLogByRange(log1, -2, 0);
            Assert.AreEqual(1, result.Log[0].LogData[0].Data.Count);
            Assert.AreEqual("0,0", result.Log[0].LogData[0].Data[0]);

            // StartIndex and EndIndex spans range
            result = _devKit.QueryLogByRange(log1, -2, 2.5);
            Assert.AreEqual(3, result.Log[0].LogData[0].Data.Count);
            Assert.AreEqual("0,0", result.Log[0].LogData[0].Data[0]);
            Assert.AreEqual("1,1", result.Log[0].LogData[0].Data[1]);
            Assert.AreEqual("2,2", result.Log[0].LogData[0].Data[2]);

            // StartIndex on start of range
            result = _devKit.QueryLogByRange(log1, 0, 1.5);
            Assert.AreEqual(2, result.Log[0].LogData[0].Data.Count);
            Assert.AreEqual("0,0", result.Log[0].LogData[0].Data[0]);
            Assert.AreEqual("1,1", result.Log[0].LogData[0].Data[1]);

            // StartIndex and EndIndex within range
            result = _devKit.QueryLogByRange(log1, 1.5, 3.5);
            Assert.AreEqual(2, result.Log[0].LogData[0].Data.Count);
            Assert.AreEqual("2,2", result.Log[0].LogData[0].Data[0]);
            Assert.AreEqual("3,3", result.Log[0].LogData[0].Data[1]);

            // EndIndex on end of range
            result = _devKit.QueryLogByRange(log1, 7.5, 9);
            Assert.AreEqual(2, result.Log[0].LogData[0].Data.Count);
            Assert.AreEqual("8,8", result.Log[0].LogData[0].Data[0]);
            Assert.AreEqual("9,9", result.Log[0].LogData[0].Data[1]);

            // StartIndex and EndIndex span range
            result = _devKit.QueryLogByRange(log1, 7.5, 11);
            Assert.AreEqual(2, result.Log[0].LogData[0].Data.Count);
            Assert.AreEqual("8,8", result.Log[0].LogData[0].Data[0]);
            Assert.AreEqual("9,9", result.Log[0].LogData[0].Data[1]);

            // StartIndex on end of range
            result = _devKit.QueryLogByRange(log1, 9, 11);
            Assert.AreEqual(1, result.Log[0].LogData[0].Data.Count);
            Assert.AreEqual("9,9", result.Log[0].LogData[0].Data[0]);

            // StartIndex and End Index below range
            result = _devKit.QueryLogByRange(log1, 10, 11);
            Assert.AreEqual(0, result.Log.Count);
        }