Ejemplo n.º 1
0
 public void WriteToDumpingBufferGoodParameters(Operations op, Codes code)
 {
     Assert.DoesNotThrow(() =>
     {
         db.WriteToDumpingBuffer(op, code, valueMock.Object);
     });
 }
 public void WriteToDumpingBuffer_DobarTest(int code, float value)
 {
     Assert.DoesNotThrow(() =>
     {
         db.WriteToDumpingBuffer((Codes)code, value);
     });
 }
Ejemplo n.º 3
0
        public void SendToDumpingBuffer()
        {
            //call logger
            Operations op = generator.GenerateRandomOperation();

            lock (syncLock)
            {
                Logger.WriteLog("Sending to Dumping buffer", MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name);
            }
            switch (op)
            {
            case Operations.ADD:
                dumpingBuffer.WriteToDumpingBuffer(op, generator.GenerateRandomCode(), generator.RandomNewValueGenerator());
                break;

            case Operations.UPDATE:
                HistoricalProperty hp = GetRandomHistoricalProperty();
                if (hp == null)
                {
                    break;
                }
                Value v = generator.RandomNewValueGenerator();
                v.GeographicalLocationId = hp.HistoricalValue.GeographicalLocationId;

                dumpingBuffer.WriteToDumpingBuffer(op, (Codes)hp.Code, v);
                break;

            case Operations.REMOVE:
                HistoricalProperty hp1 = GetRandomHistoricalProperty();
                if (hp1 == null)
                {
                    break;
                }
                dumpingBuffer.WriteToDumpingBuffer(op, (Codes)hp1.Code, hp1.HistoricalValue);
                //search through existing properties and remove a property
                break;
            }

            Thread.Sleep(2000);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Function automatically sending Code and Value to DumpingBuffer
        /// </summary>
        public void SendToDumpingBuffer()
        {
            string className    = MethodBase.GetCurrentMethod().DeclaringType.Name;
            string functionName = MethodBase.GetCurrentMethod().Name;

            Generate();
            Console.WriteLine("Sending to Dumping Buffer\n");
            lock (Gate)
            {
                Logger.Log(className, functionName, "Sending to Dumping Buffer");
            }

            // TO DO: make a call to Dumping Buffer
            db.WriteToDumpingBuffer(Code, Value);

            Thread.Sleep(2000);
        }