示例#1
0
public void MONotEqualsCurrencyTest() {
MARC.Everest.DataTypes.MO aValue = new MARC.Everest.DataTypes.MO(), bValue = new MARC.Everest.DataTypes.MO();
aValue.Currency = "0";
aValue.Precision = 0;
aValue.Expression = new MARC.Everest.DataTypes.ED(new System.Byte[] { 0 },"0");
aValue.OriginalText = new MARC.Everest.DataTypes.ED(new System.Byte[] { 0 },"0");
aValue.UncertaintyType = new System.Nullable<MARC.Everest.DataTypes.Interfaces.QuantityUncertaintyType>(MARC.Everest.DataTypes.Interfaces.QuantityUncertaintyType.Uniform);
aValue.Value = (decimal)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.Currency = "1";
bValue.Precision = 0;
bValue.Expression = new MARC.Everest.DataTypes.ED(new System.Byte[] { 0 },"0");
bValue.OriginalText = new MARC.Everest.DataTypes.ED(new System.Byte[] { 0 },"0");
bValue.UncertaintyType = new System.Nullable<MARC.Everest.DataTypes.Interfaces.QuantityUncertaintyType>(MARC.Everest.DataTypes.Interfaces.QuantityUncertaintyType.Uniform);
bValue.Value = (decimal)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);
}
示例#2
0
 public void MOEqualsSerializationTest()
 {
     MARC.Everest.DataTypes.MO aValue = new MARC.Everest.DataTypes.MO(), bValue = null;
     aValue.Currency = "0";
     aValue.Value = (decimal)0.0f;
     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.MO>(fmtr.Parse(rdr, typeof(MARC.Everest.DataTypes.MO)).Structure);
     Assert.AreEqual(aValue, bValue);
 }