예제 #1
0
 public void SXPRNotEqualsComponentTest()
 {
     MARC.Everest.DataTypes.SXPR <MARC.Everest.DataTypes.INT> aValue = new MARC.Everest.DataTypes.SXPR <MARC.Everest.DataTypes.INT>(), bValue = new MARC.Everest.DataTypes.SXPR <MARC.Everest.DataTypes.INT>();
     aValue.Terms = new MARC.Everest.DataTypes.LIST <MARC.Everest.DataTypes.SXCM <MARC.Everest.DataTypes.INT> >(0)
     {
         new MARC.Everest.DataTypes.IVL <MARC.Everest.DataTypes.INT>(new MARC.Everest.DataTypes.INT(0))
     };
     aValue.Operator       = new System.Nullable <MARC.Everest.DataTypes.SetOperator>(MARC.Everest.DataTypes.SetOperator.Hull);
     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.Terms          = new MARC.Everest.DataTypes.LIST <MARC.Everest.DataTypes.SXCM <MARC.Everest.DataTypes.INT> >(1)
     {
         new MARC.Everest.DataTypes.IVL <MARC.Everest.DataTypes.INT>(new MARC.Everest.DataTypes.INT(1))
     };
     bValue.Operator       = new System.Nullable <MARC.Everest.DataTypes.SetOperator>(MARC.Everest.DataTypes.SetOperator.Hull);
     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 SXPRNotEqualsComponentTest() {
MARC.Everest.DataTypes.SXPR<MARC.Everest.DataTypes.INT> aValue = new MARC.Everest.DataTypes.SXPR<MARC.Everest.DataTypes.INT>(), bValue = new MARC.Everest.DataTypes.SXPR<MARC.Everest.DataTypes.INT>();
aValue.Terms = new MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.SXCM<MARC.Everest.DataTypes.INT>>(0) { new MARC.Everest.DataTypes.IVL<MARC.Everest.DataTypes.INT>(new MARC.Everest.DataTypes.INT(0)) };
aValue.Operator = new System.Nullable<MARC.Everest.DataTypes.SetOperator>(MARC.Everest.DataTypes.SetOperator.Hull);
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.Terms = new MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.SXCM<MARC.Everest.DataTypes.INT>>(1) { new MARC.Everest.DataTypes.IVL<MARC.Everest.DataTypes.INT>(new MARC.Everest.DataTypes.INT(1)) };
bValue.Operator = new System.Nullable<MARC.Everest.DataTypes.SetOperator>(MARC.Everest.DataTypes.SetOperator.Hull);
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);
}
예제 #3
0
 public void SXPREqualsSerializationTest()
 {
     MARC.Everest.DataTypes.SXPR<MARC.Everest.DataTypes.INT> aValue = new MARC.Everest.DataTypes.SXPR<MARC.Everest.DataTypes.INT>(), bValue = null;
     aValue.Terms = new MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.SXCM<MARC.Everest.DataTypes.INT>>(0) { new MARC.Everest.DataTypes.IVL<MARC.Everest.DataTypes.INT>(new MARC.Everest.DataTypes.INT(0)) };
     aValue.Operator = new System.Nullable<MARC.Everest.DataTypes.SetOperator>(MARC.Everest.DataTypes.SetOperator.Hull);
     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.SXPR<MARC.Everest.DataTypes.INT>>(fmtr.Parse(rdr, typeof(MARC.Everest.DataTypes.SXPR<MARC.Everest.DataTypes.INT>)).Structure);
     Assert.AreEqual(aValue, bValue);
 }