コード例 #1
0
	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();
        }
    }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
            });
        }