Esempio n. 1
0
        public void EtpUris_GetUri_Can_Get_Log_ChannelSet_200_ChannelIndex_Uri()
        {
            var channelIndex = new Witsml200.ComponentSchemas.ChannelIndex {
                Mnemonic = "MD"
            };
            var channel = new Witsml200.Channel {
                Uuid = _data.Uid(), Mnemonic = "ROP", Index = new List <Witsml200.ComponentSchemas.ChannelIndex> {
                    channelIndex
                }
            };
            var channelSet = new Witsml200.ChannelSet {
                Uuid = _data.Uid(), Channel = new List <Witsml200.Channel> {
                    channel
                }
            };
            var log = new Witsml200.Log {
                Uuid = _data.Uid(), ChannelSet = new List <Witsml200.ChannelSet> {
                    channelSet
                }
            };

            var uri = channelIndex.GetUri(log, channelSet);

            Assert.IsTrue($"eml://witsml20/Log({log.Uuid})/ChannelSet({channelSet.Uuid})/ChannelIndex({channelIndex.Mnemonic})".EqualsIgnoreCase(uri.ToString()));
            Assert.AreEqual(ObjectTypes.ChannelIndex.ToPascalCase(), uri.ObjectType);
            Assert.AreEqual(channelIndex.Mnemonic, uri.ObjectId);
        }
Esempio n. 2
0
        public void EtpUris_GetUri_Can_Get_ChannelSet_200_Channel_Uri()
        {
            var channel = new Witsml200.Channel {
                Uuid = _data.Uid(), Mnemonic = "ROP"
            };
            var channelSet = new Witsml200.ChannelSet {
                Uuid = _data.Uid(), Channel = new List <Witsml200.Channel> {
                    channel
                }
            };

            var uri = channel.GetUri(channelSet);

            Assert.IsTrue($"eml://witsml20/ChannelSet({channelSet.Uuid})/Channel({channel.Uuid})".EqualsIgnoreCase(uri.ToString()));
            Assert.AreEqual(ObjectTypes.Channel.ToPascalCase(), uri.ObjectType);
            Assert.AreEqual(channel.Uuid, uri.ObjectId);
        }
Esempio n. 3
0
        public void EtpUris_GetUri_Can_Get_Channel_200_ChannelIndex_Uri()
        {
            var channelIndex = new Witsml200.ComponentSchemas.ChannelIndex {
                Mnemonic = "MD"
            };
            var channel = new Witsml200.Channel {
                Uuid = _data.Uid(), Mnemonic = "ROP", Index = new List <Witsml200.ComponentSchemas.ChannelIndex> {
                    channelIndex
                }
            };

            var uri = channelIndex.GetUri(channel);

            Assert.IsTrue($"eml://witsml20/Channel({channel.Uuid})/ChannelIndex({channelIndex.Mnemonic})".EqualsIgnoreCase(uri.ToString()));
            Assert.AreEqual(ObjectTypes.ChannelIndex, uri.ObjectType);
            Assert.AreEqual(channelIndex.Mnemonic, uri.ObjectId);
        }
Esempio n. 4
0
        public void EtpUris_GetUri_Can_Get_Log_ChannelSet_200_Channel_Uri()
        {
            var channel = new Witsml200.Channel {
                Mnemonic = "ROP"
            };
            var channelSet = new Witsml200.ChannelSet {
                Uuid = _data.Uid(), Channel = new List <Witsml200.Channel> {
                    channel
                }
            };
            var log = new Witsml200.Log {
                Uuid = _data.Uid(), ChannelSet = new List <Witsml200.ChannelSet> {
                    channelSet
                }
            };
            var uri = channel.GetUri(log, channelSet);

            Assert.IsTrue($"eml://witsml20/Log({log.Uuid})/ChannelSet({ channelSet.Uuid })/Channel({channel.Mnemonic})".EqualsIgnoreCase(uri.ToString()));
            Assert.AreEqual(ObjectTypes.Channel, uri.ObjectType);
            Assert.AreEqual(channel.Mnemonic, uri.ObjectId);
        }
Esempio n. 5
0
 /// <summary>
 /// Adds the channel to a <see cref="ChannelDataBlock"/> instance from a <see cref="Witsml200.ChannelSet"/>.
 /// </summary>
 /// <param name="dataBlock">The channel data block.</param>
 /// <param name="channelId">Then channel Id.</param>
 /// <param name="channel">The channel.</param>
 public static void AddChannel(this ChannelDataBlock dataBlock, int channelId, Witsml200.Channel channel)
 {
     dataBlock.AddChannel(
         channelId,
         channel.Mnemonic,
         channel.Uom.ToString(),
         channel.DataType?.ToString());
 }
Esempio n. 6
0
 /// <summary>
 /// Gets the <see cref="EtpUri"/> for a given <see cref="Energistics.DataAccess.WITSML200.ComponentSchemas.ChannelIndex"/>
 /// </summary>
 /// <param name="entity">The entity.</param>
 /// <param name="channel">The channel.</param>
 /// <returns>An <see cref="EtpUri"/> instance.</returns>
 public static EtpUri GetUri(this Witsml200.ComponentSchemas.ChannelIndex entity, Witsml200.Channel channel)
 {
     return(channel.GetUri()
            .Append(ObjectTypes.ChannelIndex, entity.Mnemonic, true));
 }
Esempio n. 7
0
 /// <summary>
 /// Gets the <see cref="EtpUri"/> for a given <see cref="Energistics.DataAccess.WITSML200.Channel"/>
 /// </summary>
 /// <param name="entity">The entity.</param>
 /// <param name="log">The log.</param>
 /// <param name="channelSet">The channel set.</param>
 /// <returns>An <see cref="EtpUri"/> instance.</returns>
 public static EtpUri GetUri(this Witsml200.Channel entity, Witsml200.Log log, Witsml200.ChannelSet channelSet)
 {
     return(channelSet.GetUri(log)
            .Append(ObjectTypes.Channel, entity.Uuid));
 }
Esempio n. 8
0
 /// <summary>
 /// Gets the <see cref="EtpUri"/> for a given <see cref="Energistics.DataAccess.WITSML200.Channel"/>
 /// </summary>
 /// <param name="entity">The entity.</param>
 /// <param name="channelSet">The channel set.</param>
 /// <returns>An <see cref="EtpUri"/> instance.</returns>
 public static EtpUri GetUri(this Witsml200.Channel entity, Witsml200.ChannelSet channelSet)
 {
     return(channelSet.GetUri()
            .Append(ObjectTypes.Channel, entity.Mnemonic));
 }