Beispiel #1
0
        public static void OverwriteNullTest()
        {
            List <String> keys = TraceUtils.TEMP_GetTraceKeys();

            SerializableString testStr1 = new
                                          SerializableString("{0955D962-2936-4FB2-AAB3-635C6FF6E0AD}");


            Dictionary <String, ISerializable> data = new Dictionary <string, ISerializable>();

            data.Add(keys[0], testStr1);


            TraceUtils.SetObjectToTLS(data);

            //Set complete, readback test

            var readback = TraceUtils.GetObjectFromTLS();

            Assert.IsTrue(((SerializableString)readback[keys[0]]).Payload == testStr1.Payload);


            data[keys[0]] = null;

            TraceUtils.SetObjectToTLS(data);

            //Set complete, readback test

            readback = TraceUtils.GetObjectFromTLS();
            Assert.IsTrue((ISerializable)readback[keys[0]] == null);
        }
Beispiel #2
0
        public static void OverwriteTest()
        {
            var key = TraceUtils.TEMP_GetTraceKeys()[0];

            SerializableString testStr1 = new
                                          SerializableString("{0955D962-2936-4FB2-AAB3-635C6FF6E0AD}");

            SerializableString testStr2 = new
                                          SerializableString("{2D7FE0ED-56F3-47A4-9BAA-8DF570170D97}");

            TraceUtils.SetTraceData(key, testStr1);

            //Set complete, readback test

            ISerializable readback = TraceUtils.GetTraceData(key);

            Assert.IsTrue(readback == testStr1);



            TraceUtils.SetTraceData(key, testStr2);

            //Set complete, readback test

            readback = TraceUtils.GetTraceData(key);
            Assert.IsTrue(readback == testStr2);
        }
Beispiel #3
0
        public static void OverwriteTest()
        {

            List<String> keys = TraceUtils.TEMP_GetTraceKeys();

            SerializableString testStr1 = new
                SerializableString("{0955D962-2936-4FB2-AAB3-635C6FF6E0AD}");

            SerializableString testStr2 = new
                SerializableString("{2D7FE0ED-56F3-47A4-9BAA-8DF570170D97}");


            var data = new Dictionary<string, ISerializable>();
            data.Add(keys[0], testStr1);

            var data2 = new Dictionary<string, ISerializable>();
            data2.Add(keys[0], testStr2);


            TraceUtils.SetObjectToTLS(data);

            //Set complete, readback test

            var readback = TraceUtils.GetObjectFromTLS();
            Assert.IsTrue(((SerializableString)readback[keys[0]]).Payload == testStr1.Payload);



            TraceUtils.SetObjectToTLS(data2);

            //Set complete, readback test

            readback = TraceUtils.GetObjectFromTLS();
            Assert.IsTrue(((SerializableString)readback[keys[0]]).Payload == testStr2.Payload);
        }
Beispiel #4
0
        public static void OverwriteNullTest()
        {
            var key = TraceUtils.TEMP_GetTraceKeys()[0];

            SerializableString testStr1 = new
                                          SerializableString("{0955D962-2936-4FB2-AAB3-635C6FF6E0AD}");

            TraceUtils.SetTraceData(key, testStr1);

            //Set complete, readback test

            ISerializable readback = TraceUtils.GetTraceData(key);

            Assert.IsTrue(readback == testStr1);

            TraceUtils.SetTraceData(key, null);

            //Set complete, readback test

            readback = TraceUtils.GetTraceData(key);
            Assert.IsTrue(readback == null);
        }
Beispiel #5
0
        public static void SetGetTest()
        {
            List <String> keys = TraceUtils.TEMP_GetTraceKeys();

            SerializableString testStr1 = new
                                          SerializableString("{0955D962-2936-4FB2-AAB3-635C6FF6E0AD}");

            SerializableString testStr2 = new
                                          SerializableString("{2D7FE0ED-56F3-47A4-9BAA-8DF570170D97}");


            Dictionary <String, ISerializable> data = new Dictionary <string, ISerializable>();

            data.Add(keys[0], testStr1);

            TraceUtils.SetObjectToTLS(data);

            //Set complete, readback test

            Dictionary <String, ISerializable> readback = TraceUtils.GetObjectFromTLS();

            Assert.IsTrue(((SerializableString)readback[keys[0]]).Payload == testStr1.Payload);
        }
Beispiel #6
0
        public static void OverwriteNullTest()
        {

            List<String> keys = TraceUtils.TEMP_GetTraceKeys();

            SerializableString testStr1 = new
                SerializableString("{0955D962-2936-4FB2-AAB3-635C6FF6E0AD}");


            Dictionary<String, ISerializable> data = new Dictionary<string, ISerializable>();
            data.Add(keys[0], testStr1);


            TraceUtils.SetObjectToTLS(data);

            //Set complete, readback test

            var readback = TraceUtils.GetObjectFromTLS();
            Assert.IsTrue(((SerializableString)readback[keys[0]]).Payload == testStr1.Payload);


            data[keys[0]] = null;

            TraceUtils.SetObjectToTLS(data);

            //Set complete, readback test

            readback = TraceUtils.GetObjectFromTLS();
            Assert.IsTrue((ISerializable)readback[keys[0]] == null);
        }