public void ManualWriteToHistory(string code, Value value){ m_DumpingBuffer.ReadFromWritter(true, code, value, false); using (var mutex = new Mutex(false, "All_Process_Mutex")) { mutex.WaitOne(); File.AppendAllText("Logfile.txt", $"Writer is writing {code} directly to the Historical...\n"); mutex.ReleaseMutex(); } }
public void ReadFromWritterGoodParameters2(bool directly, string code, bool remove, int dataset) { Mock <Value> valMock = new Mock <Value>("1337", 2142); DumpingBuffer dbObj = dbMock.Object; Value valObj = valMock.Object; dbObj.ReadFromWritter(directly, code, valObj, remove); Assert.AreEqual(dbObj.CdDic[dataset].Dpc.dumpingPropertyList[0].DumpingValue.IDGeoPolozaja, valObj.IDGeoPolozaja); }
public void ReadFromWritterGoodParameters(bool directly, string code, bool remove, int dataset) { Mock <Value> valMock = new Mock <Value>("1312", 500); DumpingBuffer dbObj = dbMock.Object; Value valObj = valMock.Object; valObj.Timestamp = DateTime.Now; dbObj.ReadFromWritter(directly, code, valObj, remove); Assert.AreEqual(dbObj.CdDic[dataset].Dpc.dumpingPropertyList[0].DumpingValue.Potrosnja, valObj.Potrosnja); }
public void ReadFromWritterBadParameters(bool directly, string code, bool remove) { Mock <Value> valMock = new Mock <Value>("1515", 1000); DumpingBuffer dbObj = dbMock.Object; Value valObj = valMock.Object; Assert.Throws <ArgumentNullException>(() => { dbObj.ReadFromWritter(directly, code, null, remove); }); }