Exemplo n.º 1
0
public void EDNotEqualsDataTest() {
MARC.Everest.DataTypes.ED aValue = new MARC.Everest.DataTypes.ED(), bValue = new MARC.Everest.DataTypes.ED();
aValue.Data = new System.Byte[] { 0 };
aValue.Compression = new System.Nullable<MARC.Everest.DataTypes.Interfaces.EncapsulatedDataCompression>(MARC.Everest.DataTypes.Interfaces.EncapsulatedDataCompression.DF);
aValue.Description = new MARC.Everest.DataTypes.ST("0");
aValue.Representation = MARC.Everest.DataTypes.Interfaces.EncapsulatedDataRepresentation.TXT;
aValue.Language = "0";
aValue.Translation = new MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.ED>(0) { new MARC.Everest.DataTypes.ED(new System.Byte[] { 0 },"0") };
aValue.MediaType = "0";
aValue.IntegrityCheck = new System.Byte[] { 0 };
aValue.IntegrityCheckAlgorithm = new System.Nullable<MARC.Everest.DataTypes.Interfaces.EncapsulatedDataIntegrityAlgorithm>(MARC.Everest.DataTypes.Interfaces.EncapsulatedDataIntegrityAlgorithm.SHA1);
aValue.Thumbnail = new MARC.Everest.DataTypes.ED(new System.Byte[] { 0 },"0");
aValue.Reference = new MARC.Everest.DataTypes.TEL("0");
aValue.NullFlavor = new MARC.Everest.DataTypes.CS<MARC.Everest.DataTypes.NullFlavor>(MARC.Everest.DataTypes.NullFlavor.AskedUnknown);
aValue.UpdateMode = new MARC.Everest.DataTypes.CS<MARC.Everest.DataTypes.UpdateMode>(MARC.Everest.DataTypes.UpdateMode.Add);
aValue.Flavor = "0";
aValue.ValidTimeLow = new MARC.Everest.DataTypes.TS(DateTime.Parse("2011-1-10"));
aValue.ValidTimeHigh = new MARC.Everest.DataTypes.TS(DateTime.Parse("2011-1-10"));
aValue.ControlActRoot = "0";
aValue.ControlActExt = "0";
bValue.Data = new System.Byte[] { 1 };
bValue.Compression = new System.Nullable<MARC.Everest.DataTypes.Interfaces.EncapsulatedDataCompression>(MARC.Everest.DataTypes.Interfaces.EncapsulatedDataCompression.DF);
bValue.Description = new MARC.Everest.DataTypes.ST("0");
bValue.Representation = MARC.Everest.DataTypes.Interfaces.EncapsulatedDataRepresentation.TXT;
bValue.Language = "0";
bValue.Translation = new MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.ED>(0) { new MARC.Everest.DataTypes.ED(new System.Byte[] { 0 },"0") };
bValue.MediaType = "0";
bValue.IntegrityCheck = new System.Byte[] { 0 };
bValue.IntegrityCheckAlgorithm = new System.Nullable<MARC.Everest.DataTypes.Interfaces.EncapsulatedDataIntegrityAlgorithm>(MARC.Everest.DataTypes.Interfaces.EncapsulatedDataIntegrityAlgorithm.SHA1);
bValue.Thumbnail = new MARC.Everest.DataTypes.ED(new System.Byte[] { 0 },"0");
bValue.Reference = new MARC.Everest.DataTypes.TEL("0");
bValue.NullFlavor = new MARC.Everest.DataTypes.CS<MARC.Everest.DataTypes.NullFlavor>(MARC.Everest.DataTypes.NullFlavor.AskedUnknown);
bValue.UpdateMode = new MARC.Everest.DataTypes.CS<MARC.Everest.DataTypes.UpdateMode>(MARC.Everest.DataTypes.UpdateMode.Add);
bValue.Flavor = "0";
bValue.ValidTimeLow = new MARC.Everest.DataTypes.TS(DateTime.Parse("2011-1-10"));
bValue.ValidTimeHigh = new MARC.Everest.DataTypes.TS(DateTime.Parse("2011-1-10"));
bValue.ControlActRoot = "0";
bValue.ControlActExt = "0";
Assert.AreNotEqual(aValue, bValue);
}
Exemplo n.º 2
0
 public void EDEqualsSerializationTest()
 {
     MARC.Everest.DataTypes.ED aValue = new MARC.Everest.DataTypes.ED(), bValue = null;
     aValue.Data = new System.Byte[] { 0 };
     aValue.Compression = new System.Nullable<MARC.Everest.DataTypes.Interfaces.EncapsulatedDataCompression>(MARC.Everest.DataTypes.Interfaces.EncapsulatedDataCompression.DF);
     aValue.Representation = MARC.Everest.DataTypes.Interfaces.EncapsulatedDataRepresentation.TXT;
     aValue.Language = "0";
     aValue.MediaType = "0";
     aValue.IntegrityCheck = new System.Byte[] { 0 };
     aValue.IntegrityCheckAlgorithm = new System.Nullable<MARC.Everest.DataTypes.Interfaces.EncapsulatedDataIntegrityAlgorithm>(MARC.Everest.DataTypes.Interfaces.EncapsulatedDataIntegrityAlgorithm.SHA1);
     aValue.Thumbnail = new MARC.Everest.DataTypes.ED(new System.Byte[] { 0 }, "0");
     aValue.Flavor = "0";
     StringWriter sw = new StringWriter();
     DatatypeFormatter fmtr = new DatatypeFormatter() { CompatibilityMode = DatatypeFormatterCompatibilityMode.Canadian };
     XmlStateWriter xw = new XmlStateWriter(XmlWriter.Create(sw, new XmlWriterSettings() { Encoding = System.Text.Encoding.UTF8 }));
     xw.WriteStartElement("test");
     fmtr.Graph(xw, aValue);
     xw.WriteEndElement(); // comp
     xw.Flush();
     StringReader sr = new StringReader(sw.ToString());
     XmlStateReader rdr = new XmlStateReader(XmlReader.Create(sr));
     rdr.Read(); rdr.Read();
     bValue = Util.Convert<MARC.Everest.DataTypes.ED>(fmtr.Parse(rdr, typeof(MARC.Everest.DataTypes.ED)).Structure);
     Assert.AreEqual(aValue, bValue);
 }