Exemplo n.º 1
0
        public void ShouldReturnParentIdentifier()
        {
            string identifier = "testIdentifier";
            MD_Metadata_Type metadata = new MD_Metadata_Type();
            metadata.parentIdentifier = new CharacterString_PropertyType{ CharacterString = identifier};

            SimpleMetadata simpleMetadata = new SimpleMetadata(metadata);

            Assert.AreEqual(identifier, simpleMetadata.ParentIdentifier);
        }
Exemplo n.º 2
0
 public void Init()
 {
     _md = new SimpleMetadata(MetadataExample.CreateMetadataExample());
 }
Exemplo n.º 3
0
        public void ShouldSetTitleWhenMissingCitation()
        {
            _md = new SimpleMetadata(new MD_Metadata_Type() {
                identificationInfo = new MD_Identification_PropertyType[] {
                    new MD_Identification_PropertyType() {
                        AbstractMD_Identification = new MD_DataIdentification_Type()
                    }
                }
            });

            UpdateTitle();

            Assert.AreEqual("This is the new title.", _md.Title);
        }
Exemplo n.º 4
0
 public void ShouldThrowExceptionWhenSettingTitleOnMetadataWithEmptyIdentificationInfoElement()
 {
     _md = new SimpleMetadata(new MD_Metadata_Type());
     Assert.Throws(typeof(NullReferenceException), new TestDelegate(UpdateTitle));
 }
Exemplo n.º 5
0
        public void ShouldReturnValidTimePeriod()
        {
            MD_Metadata_Type metadata = new MD_Metadata_Type();
            metadata.hierarchyLevel = new MD_ScopeCode_PropertyType[]
            {
                new MD_ScopeCode_PropertyType()
                {
                    MD_ScopeCode = new CodeListValue_Type()
                    {
                        codeListValue = "service"
                    }
                }

            };

            metadata.identificationInfo = new MD_Identification_PropertyType[]
            {
             new MD_Identification_PropertyType{
              AbstractMD_Identification =  new SV_ServiceIdentification_Type()
              {
                extent = new EX_Extent_PropertyType[]
                {
                    new EX_Extent_PropertyType
                    {
                        EX_Extent = new EX_Extent_Type()
                        {
                         temporalElement= new EX_TemporalExtent_PropertyType[]
                         {
                            new EX_TemporalExtent_PropertyType()
                            {
                                EX_TemporalExtent = new EX_TemporalExtent_Type()
                                {
                                   extent = new TM_Primitive_PropertyType()
                                   {
                                       AbstractTimePrimitive =  new TimePeriodType()
                                       {
                                           Item= new TimePositionType()
                                           {
                                               Value = "2010-01-01T12:00:00"
                                           },
                                          Item1= new TimePositionType()
                                          {
                                              Value = "2018-01-01T12:00:00"
                                          }
                                        }
                                    }
                                }
                            }
                         }
                        }
                    }
                }
              }
             }
            };

            SimpleMetadata simpleMetadata = new SimpleMetadata(metadata);
            Assert.NotNull(simpleMetadata.ValidTimePeriod);
            Assert.AreEqual("2010-01-01T12:00:00", simpleMetadata.ValidTimePeriod.ValidFrom);
            Assert.AreEqual("2018-01-01T12:00:00", simpleMetadata.ValidTimePeriod.ValidTo);
        }