public void SetupTest() { modul2 = new Modul2(); modul2Property = new Modul2Property(); historicalCollection = new HistoricalCollection(); collectionDescription = new CollectionDescription(); }
public bool ReceiveFromInput(Code code, int value) { Modul2Property hp = new Modul2Property(); m_CollectionDescription = new CollectionDescription(); m_CollectionDescription.Id = (int)((DateTime.Now.Ticks / 10) % 1000000000); hp.Code = code; hp.Modul2Value = value; m_CollectionDescription.m_HistoricalCollection.m_Modul2Property[0] = hp; Codes codes = new Codes(); m_CollectionDescription.Dataset = codes.GetDataset(code); if (ValidationCheck(m_CollectionDescription.m_HistoricalCollection.m_Modul2Property[0].Code, m_CollectionDescription.Dataset)) { Logger.Log("ReceiveFromInput u Modulu2 je konvertovala primljene podatke u CollectionDescription"); Logger.Log("CD : " + m_CollectionDescription + "\n"); Serialize(m_CollectionDescription); } else { Logger.Log("Validacija Dataset-a u Modulu2 nije prosla.\n"); return false; } return true; }
public void SerializeOkParameter(Code code, int value, int dataSet) { Modul2Property hp = new Modul2Property() { Code = code, Modul2Value = value }; HistoricalCollection histColl = new HistoricalCollection(); histColl.m_Modul2Property[0] = hp; CollectionDescription collDesc = new CollectionDescription(); collDesc.Dataset = dataSet; collDesc.Id = 1235; collDesc.timeStamp = DateTime.Now; collDesc.m_HistoricalCollection = histColl; Assert.IsFalse(modul2.Serialize(collDesc)); }
// prima podatke od Modula1 ili direktno od Inputa // skladisti podatke u xml fajl // po vrsti dataset-a(kojih ima 4 vrste-1,2,3,4) ima i razlicite baze(4 xml fajla) // podaci su skladisteni u formi CollectionDescription-a public bool ReceiveFromModul1(ListDescription listdescription) { if (listdescription == null) { throw new ArgumentNullException("listdescription"); } foreach (Description d in listdescription.m_Description) { m_CollectionDescription = new CollectionDescription(); m_CollectionDescription.Id = d.Id; m_CollectionDescription.timeStamp = DateTime.Now; foreach (Modul1Property dp in d._m1Property) { Modul2Property hp = new Modul2Property(); hp.Code = dp.Code; help = dp.Code; hp.Modul2Value = dp.Value; m_CollectionDescription.m_HistoricalCollection.m_Modul2Property[0] = hp; } m_CollectionDescription.Dataset = d.Dataset; if (ValidationCheck(m_CollectionDescription.m_HistoricalCollection.m_Modul2Property[0].Code, m_CollectionDescription.Dataset)) { Logger.Log("\nReceiveFromModul1 u Modulu2 prepakovalo je posatke u ColectionDescription.\n"); Logger.Log("CD : " + m_CollectionDescription + "\n"); Serialize(m_CollectionDescription); } else { Logger.Log("Validacija Dataset-a u Modulu2 nije prosla.\n"); return false; } } return true; }
public void CheckDeadbandTestNotOk(Code code, int value, int dataSet) { Modul2Property hp = new Modul2Property() { Code = code, Modul2Value = value }; HistoricalCollection histColl = new HistoricalCollection(); histColl.m_Modul2Property[0] = hp; CollectionDescription collDesc = new CollectionDescription(); collDesc.Dataset = dataSet; collDesc.Id = 123456; collDesc.timeStamp = DateTime.Now; collDesc.m_HistoricalCollection = histColl; Assert.AreEqual(modul2.CheckDeadband(collDesc), true); }