/// <summary>
        /// Gets value for a key
        /// </summary>
        /// <param name="key">Key of the element</param>
        /// <remarks></remarks>
        public StringMutable GetValue(StringMutable key)
        {
            var returnValue = new StringMutable();
            var x1          = key == "DefaultConnection" ? true : false;

            returnValue = this.FindSafe(x => x.Key == key.ToString()).Value;
            var key2 = key;

            returnValue = this.FindSafe(x => x.Key == key2).Value;
            returnValue = this.FindSafe(x => x.Key == key).Value;
            return(returnValue);
        }
 public void Serialization_Json_ValueTypes()
 {
     // Immutable string class
     var data1= TypeExtension.DefaultString;
     var Testdata1= "TestDataHere";
     ISerializer<object> Serialzer1 = new JsonSerializer<object>();
     data1= Serialzer1.Serialize(Testdata1);
     Assert.IsTrue(Serialzer1.Deserialize(data1).ToString() == Testdata1);
     
     var data = TypeExtension.DefaultString;
     StringMutable TestData = "TestDataHere";
     var Serialzer = new JsonSerializer<StringMutable>();
     data = Serialzer.Serialize(TestData);
     Assert.IsTrue(Serialzer.Deserialize(data).ToString() == TestData.ToString());
 }
示例#3
0
        public void Serialization_Json_ValueTypes()
        {
            var data1     = TypeExtension.DefaultString;
            var testData1 = "TestDataHere";
            ISerializer <object> serialzer1 = new JsonSerializer <object>();

            data1 = serialzer1.Serialize(testData1);
            Assert.IsTrue(serialzer1.Deserialize(data1).ToString() == testData1);

            var           data      = TypeExtension.DefaultString;
            StringMutable testData  = "TestDataHere";
            var           serialzer = new JsonSerializer <StringMutable>();

            data = serialzer.Serialize(testData);
            Assert.IsTrue(serialzer.Deserialize(data).ToString() == testData.ToString());
        }
示例#4
0
        public void Serialization_Serializer_ValueTypes()
        {
            // Immutable string class
            var data1     = Defaults.String;
            var TestData1 = "TestDataHere";
            ISerializer <object> serialzer1 = new JsonSerializer <object>();

            data1 = serialzer1.Serialize(TestData1);
            Assert.IsTrue(serialzer1.Deserialize(data1).ToString() == TestData1);


            var           data      = Defaults.String;
            StringMutable testData  = "TestDataHere";
            var           Serialzer = new JsonSerializer <StringMutable>();

            data = Serialzer.Serialize(testData);
            Assert.IsTrue(Serialzer.Deserialize(data).ToString() == testData.ToString());
        }
        public void Core_Serialization_SerializerGeneric_ValueTypes()
        {
            // Immutable string class
            var data1     = string.Empty;
            var Testdata1 = "TestDataHere";
            ISerializer <object> Serialzer1 = new JsonSerializer <object>();

            data1 = Serialzer1.Serialize(Testdata1);
            Assert.IsTrue(Serialzer1.Deserialize(data1).ToString() == Testdata1);


            var           data      = string.Empty;
            StringMutable TestData  = "TestDataHere";
            var           Serialzer = new JsonSerializer <StringMutable>();

            data = Serialzer.Serialize(TestData);
            Assert.IsTrue(Serialzer.Deserialize(data).ToString() == TestData.ToString());
        }