Beispiel #1
0
        public void EtpSupportedDataObjectCollection_Intersection_Instance_DataObjects_And_Counterpart_WildCard()
        {
            var instanceDataObjects = new List <EtpSupportedDataObject>
            {
                new EtpSupportedDataObject(new EtpDataObjectType("witsml", "2.0", "Well"), new EtpDataObjectCapabilities {
                    ActiveTimeoutPeriod = int.MaxValue
                }),
                new EtpSupportedDataObject(new EtpDataObjectType("witsml", "2.0", "Wellbore"), new EtpDataObjectCapabilities {
                    MaxDataObjectSize = 999999999
                }),
                new EtpSupportedDataObject(new EtpDataObjectType("prodml", "2.0", "*"), new EtpDataObjectCapabilities {
                    SupportsDelete = true
                }),
            };
            var counterpartDataObjects = new List <EtpSupportedDataObject>
            {
                new EtpSupportedDataObject(new EtpDataObjectType("witsml", "2.0", "*"), new EtpDataObjectCapabilities {
                    SupportsPut = false
                }),
            };

            var collection = EtpSupportedDataObjectCollection.GetSupportedDataObjectCollection(instanceDataObjects, counterpartDataObjects, true);

            Assert.AreEqual(2, collection.SupportedTypes.Count());
            Assert.AreEqual("Well", collection.SupportedTypes.ToList()[0].QualifiedType.ObjectType);
            Assert.AreEqual("Wellbore", collection.SupportedTypes.ToList()[1].QualifiedType.ObjectType);
            Assert.AreEqual(int.MaxValue, collection.SupportedTypes.First().Capabilities.ActiveTimeoutPeriod);
            Assert.AreEqual(false, collection.SupportedTypes.First().CounterpartCapabilities.SupportsPut);
            Assert.AreEqual(0, collection.SupportedFamilies.Count());
        }
Beispiel #2
0
        public void EtpSupportedDataObjectCollection_Intersection_DataObject_In_Common()
        {
            var instanceDataObjects = new List <EtpSupportedDataObject>
            {
                new EtpSupportedDataObject(new EtpDataObjectType("witsml", "2.0", "Well"), new EtpDataObjectCapabilities {
                    ActiveTimeoutPeriod = int.MaxValue
                }),
                new EtpSupportedDataObject(new EtpDataObjectType("witsml", "2.0", "Wellbore"), new EtpDataObjectCapabilities {
                    MaxDataObjectSize = 999999999
                }),
            };
            var counterpartDataObjects = new List <EtpSupportedDataObject>
            {
                new EtpSupportedDataObject(new EtpDataObjectType("witsml", "2.0", "Well"), new EtpDataObjectCapabilities {
                    SupportsPut = false
                }),
                new EtpSupportedDataObject(new EtpDataObjectType("witsml", "2.0", "ChannelSet"), new EtpDataObjectCapabilities {
                    SupportsDelete = true
                }),
            };

            var collection = EtpSupportedDataObjectCollection.GetSupportedDataObjectCollection(instanceDataObjects, counterpartDataObjects, true);

            Assert.AreEqual(1, collection.SupportedTypes.Count());
            Assert.AreEqual(int.MaxValue, collection.SupportedTypes.First().Capabilities.ActiveTimeoutPeriod);
            Assert.AreEqual(false, collection.SupportedTypes.First().CounterpartCapabilities.SupportsPut);
            Assert.AreEqual(0, collection.SupportedFamilies.Count());
        }
Beispiel #3
0
        public void EtpSupportedDataObjectCollection_Union_Nothing_In_Common()
        {
            var instanceDataObjects = new List <EtpSupportedDataObject>
            {
                new EtpSupportedDataObject(new EtpDataObjectType("witsml", "2.0", "*")),
            };
            var counterpartDataObjects = new List <EtpSupportedDataObject>
            {
                new EtpSupportedDataObject(new EtpDataObjectType("resqml", "2.0.1", "*")),
            };

            var collection = EtpSupportedDataObjectCollection.GetSupportedDataObjectCollection(instanceDataObjects, counterpartDataObjects, false);

            Assert.AreEqual(0, collection.SupportedTypes.Count());
            Assert.AreEqual(2, collection.SupportedFamilies.Count());
        }
Beispiel #4
0
        public void EtpSupportedDataObjectCollection_Union_DataObject_In_Common()
        {
            var instanceDataObjects = new List <EtpSupportedDataObject>
            {
                new EtpSupportedDataObject(new EtpDataObjectType("witsml", "2.0", "Well")),
                new EtpSupportedDataObject(new EtpDataObjectType("witsml", "2.0", "Wellbore")),
            };
            var counterpartDataObjects = new List <EtpSupportedDataObject>
            {
                new EtpSupportedDataObject(new EtpDataObjectType("witsml", "2.0", "Well")),
                new EtpSupportedDataObject(new EtpDataObjectType("witsml", "2.0", "ChannelSet")),
            };

            var collection = EtpSupportedDataObjectCollection.GetSupportedDataObjectCollection(instanceDataObjects, counterpartDataObjects, false);

            Assert.AreEqual(3, collection.SupportedTypes.Count());
            Assert.AreEqual(0, collection.SupportedFamilies.Count());
        }
Beispiel #5
0
        public void EtpSupportedDataObjectCollection_Union_Instance_DataObjects_And_Counterpart_Empty()
        {
            var instanceDataObjects = new List <EtpSupportedDataObject>
            {
                new EtpSupportedDataObject(new EtpDataObjectType("witsml", "2.0", "Well")),
                new EtpSupportedDataObject(new EtpDataObjectType("witsml", "2.0", "Wellbore")),
                new EtpSupportedDataObject(new EtpDataObjectType("prodml", "2.0", "*")),
            };
            var counterpartDataObjects = new List <EtpSupportedDataObject>
            {
            };

            var collection = EtpSupportedDataObjectCollection.GetSupportedDataObjectCollection(instanceDataObjects, counterpartDataObjects, false);

            Assert.AreEqual(2, collection.SupportedTypes.Count());
            Assert.AreEqual("Well", collection.SupportedTypes.ToList()[0].QualifiedType.ObjectType);
            Assert.AreEqual("Wellbore", collection.SupportedTypes.ToList()[1].QualifiedType.ObjectType);
            Assert.AreEqual(1, collection.SupportedFamilies.Count());
        }
Beispiel #6
0
        public void EtpSupportedDataObjectCollection_Intersection_Nothing_In_Common()
        {
            var instanceDataObjects = new List <EtpSupportedDataObject>
            {
                new EtpSupportedDataObject(new EtpDataObjectType("witsml", "2.0", "*"), new EtpDataObjectCapabilities {
                    ActiveTimeoutPeriod = int.MaxValue
                }),
            };
            var counterpartDataObjects = new List <EtpSupportedDataObject>
            {
                new EtpSupportedDataObject(new EtpDataObjectType("resqml", "2.0.1", "*"), new EtpDataObjectCapabilities {
                    MaxDataObjectSize = 999999999
                }),
            };

            var collection = EtpSupportedDataObjectCollection.GetSupportedDataObjectCollection(instanceDataObjects, counterpartDataObjects, true);

            Assert.AreEqual(0, collection.SupportedTypes.Count());
            Assert.AreEqual(0, collection.SupportedFamilies.Count());
        }
Beispiel #7
0
        public void EtpSupportedDataObjectCollection_Intersection_Instance_DataObjects_And_Counterpart_Empty()
        {
            var instanceDataObjects = new List <EtpSupportedDataObject>
            {
                new EtpSupportedDataObject(new EtpDataObjectType("witsml", "2.0", "Well"), new EtpDataObjectCapabilities {
                    ActiveTimeoutPeriod = int.MaxValue
                }),
                new EtpSupportedDataObject(new EtpDataObjectType("witsml", "2.0", "Wellbore"), new EtpDataObjectCapabilities {
                    MaxDataObjectSize = 999999999
                }),
                new EtpSupportedDataObject(new EtpDataObjectType("prodml", "2.0", "*"), new EtpDataObjectCapabilities {
                    SupportsDelete = true
                }),
            };
            var counterpartDataObjects = new List <EtpSupportedDataObject>
            {
            };

            var collection = EtpSupportedDataObjectCollection.GetSupportedDataObjectCollection(instanceDataObjects, counterpartDataObjects, true);

            Assert.AreEqual(0, collection.SupportedTypes.Count());
            Assert.AreEqual(0, collection.SupportedFamilies.Count());
        }