[NUI] fix dispose warning CA2000 for text testcase
authorBowon Ryu <bowon.ryu@samsung.com>
Fri, 31 Dec 2021 05:02:45 +0000 (14:02 +0900)
committerSeoyeon2Kim <34738918+Seoyeon2Kim@users.noreply.github.com>
Wed, 12 Jan 2022 08:40:18 +0000 (17:40 +0900)
https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2000

Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/BaseComponents/TSTextMapHelper.cs

index 6babee3..a906790 100644 (file)
@@ -185,14 +185,16 @@ namespace Tizen.NUI.Devel.Tests
                 Slant = FontSlantType.Italic
             };
 
-            var map = TextMapHelper.GetFontStyleMap(fontStyle);
-            map["width"].Get(out string width);
-            map["weight"].Get(out string weight);
-            map["slant"].Get(out string slant);
+            using (PropertyMap map = TextMapHelper.GetFontStyleMap(fontStyle))
+            {
+                map.Find(0, "width").Get(out string width);
+                map.Find(0, "weight").Get(out string weight);
+                map.Find(0, "slant").Get(out string slant);
 
-            Assert.AreEqual("expanded", width, "Should be equal!");
-            Assert.AreEqual("bold", weight, "Should be equal!");
-            Assert.AreEqual("italic", slant, "Should be equal!");
+                Assert.AreEqual("expanded", width, "Should be equal!");
+                Assert.AreEqual("bold", weight, "Should be equal!");
+                Assert.AreEqual("italic", slant, "Should be equal!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetFontStyleMap END (OK)");
         }
@@ -208,15 +210,17 @@ namespace Tizen.NUI.Devel.Tests
         {
             tlog.Debug(tag, $"TextMapHelperGetFontStyleStruct START");
 
-            var map = new PropertyMap();
-            map.Add("width", new PropertyValue("expanded"));
-            map.Add("weight", new PropertyValue("bold"));
-            map.Add("slant", new PropertyValue("italic"));
+            using (var map = new PropertyMap())
+            {
+                map.Add("width", "expanded");
+                map.Add("weight", "bold");
+                map.Add("slant", "italic");
 
-            FontStyle fontStyle = TextMapHelper.GetFontStyleStruct(map);
-            Assert.AreEqual(FontWidthType.Expanded, fontStyle.Width, "Should be equal!");
-            Assert.AreEqual(FontWeightType.Bold, fontStyle.Weight, "Should be equal!");
-            Assert.AreEqual(FontSlantType.Italic, fontStyle.Slant, "Should be equal!");
+                FontStyle fontStyle = TextMapHelper.GetFontStyleStruct(map);
+                Assert.AreEqual(FontWidthType.Expanded, fontStyle.Width, "Should be equal!");
+                Assert.AreEqual(FontWeightType.Bold, fontStyle.Weight, "Should be equal!");
+                Assert.AreEqual(FontSlantType.Italic, fontStyle.Slant, "Should be equal!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetFontStyleStruct END (OK)");
         }
@@ -238,12 +242,14 @@ namespace Tizen.NUI.Devel.Tests
                 Rejected = "[0-3]"
             };
 
-            var map = TextMapHelper.GetInputFilterMap(inputFilter);
-            map.Find(0).Get(out string accepted);
-            map.Find(1).Get(out string rejected);
+            using (PropertyMap map = TextMapHelper.GetInputFilterMap(inputFilter))
+            {
+                map.Find(0).Get(out string accepted);
+                map.Find(1).Get(out string rejected);
 
-            Assert.AreEqual(accepted, inputFilter.Accepted, "Should be equal!");
-            Assert.AreEqual(rejected, inputFilter.Rejected, "Should be equal!");
+                Assert.AreEqual(accepted, inputFilter.Accepted, "Should be equal!");
+                Assert.AreEqual(rejected, inputFilter.Rejected, "Should be equal!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetInputFilterMap END (OK)");
         }
@@ -259,13 +265,15 @@ namespace Tizen.NUI.Devel.Tests
         {
             tlog.Debug(tag, $"TextMapHelperGetInputFilterStruct START");
 
-            var map = new PropertyMap();
-            map.Add(0, new PropertyValue(@"[\d]"));
-            map.Add(1, new PropertyValue("[0-3]"));
+            using (var map = new PropertyMap())
+            {
+                map.Add(0, @"[\d]");
+                map.Add(1, "[0-3]");
 
-            var inputFilter = TextMapHelper.GetInputFilterStruct(map);
-            Assert.AreEqual(@"[\d]", inputFilter.Accepted, "Should be equal!");
-            Assert.AreEqual("[0-3]", inputFilter.Rejected, "Should be equal!");
+                var inputFilter = TextMapHelper.GetInputFilterStruct(map);
+                Assert.AreEqual(@"[\d]", inputFilter.Accepted, "Should be equal!");
+                Assert.AreEqual("[0-3]", inputFilter.Rejected, "Should be equal!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetInputFilterStruct END (OK)");
         }
@@ -288,15 +296,18 @@ namespace Tizen.NUI.Devel.Tests
                 Height = 2.0f
             };
 
-            var map = TextMapHelper.GetUnderlineMap(underline);
-            var color = new Color();
-            map.Find(0, "enable").Get(out bool enable);
-            map.Find(0, "color").Get(color);
-            map.Find(0, "height").Get(out float height);
+            using (PropertyMap map = TextMapHelper.GetUnderlineMap(underline))
+            {
+                var color = new Color();
+                map.Find(0, "enable").Get(out bool enable);
+                map.Find(0, "color").Get(color);
+                map.Find(0, "height").Get(out float height);
 
-            Assert.AreEqual(enable, underline.Enable, "Should be equal!");
-            Assert.AreEqual(height, underline.Height, "Should be equal!");
-            Assert.AreEqual(true, CheckColor(color, underline.Color), "Should be true!");
+                Assert.AreEqual(enable, underline.Enable, "Should be equal!");
+                Assert.AreEqual(height, underline.Height, "Should be equal!");
+                Assert.AreEqual(true, CheckColor(color, underline.Color), "Should be true!");
+                color.Dispose();
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetUnderlineMap END (OK)");
         }
@@ -312,17 +323,19 @@ namespace Tizen.NUI.Devel.Tests
         {
             tlog.Debug(tag, $"TextMapHelperGetUnderlineStruct START");
 
-            var map = new PropertyMap();
-            var color = new Color("#3498DB");
-            map.Add("enable", new PropertyValue(true));
-            map.Add("color", new PropertyValue(color));
-            map.Add("height", new PropertyValue((float)2.0f));
-
-            var underline = TextMapHelper.GetUnderlineStruct(map);
-
-            Assert.AreEqual(true, underline.Enable, "Should be equal!");
-            Assert.AreEqual(2.0f, underline.Height, "Should be equal!");
-            Assert.AreEqual(true, CheckColor(color, underline.Color), "Should be true!");
+            using (var map = new PropertyMap())
+            {
+                var color = new Color("#3498DB");
+                map.Add("enable", true);
+                map.Add("color", color);
+                map.Add("height", (float)2.0f);
+
+                var underline = TextMapHelper.GetUnderlineStruct(map);
+                Assert.AreEqual(true, underline.Enable, "Should be equal!");
+                Assert.AreEqual(2.0f, underline.Height, "Should be equal!");
+                Assert.AreEqual(true, CheckColor(color, underline.Color), "Should be true!");
+                color.Dispose();
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetUnderlineStruct END (OK)");
         }
@@ -345,16 +358,20 @@ namespace Tizen.NUI.Devel.Tests
                 BlurRadius = 2.0f,
             };
 
-            var map = TextMapHelper.GetShadowMap(shadow);
-            var offset = new Vector2();
-            var color = new Color();
-            map.Find(0, "offset").Get(offset);
-            map.Find(0, "color").Get(color);
-            map.Find(0, "blurRadius").Get(out float blurRadius);
-
-            Assert.AreEqual(blurRadius, shadow.BlurRadius, "Should be equal!");
-            Assert.AreEqual(true, CheckVector2(offset, shadow.Offset), "Should be true!");
-            Assert.AreEqual(true, CheckColor(color, shadow.Color), "Should be true!");
+            using (PropertyMap map = TextMapHelper.GetShadowMap(shadow))
+            {
+                var offset = new Vector2();
+                var color = new Color();
+                map.Find(0, "offset").Get(offset);
+                map.Find(0, "color").Get(color);
+                map.Find(0, "blurRadius").Get(out float blurRadius);
+
+                Assert.AreEqual(blurRadius, shadow.BlurRadius, "Should be equal!");
+                Assert.AreEqual(true, CheckVector2(offset, shadow.Offset), "Should be true!");
+                Assert.AreEqual(true, CheckColor(color, shadow.Color), "Should be true!");
+                offset.Dispose();
+                color.Dispose();
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetShadowMap END (OK)");
         }
@@ -374,16 +391,20 @@ namespace Tizen.NUI.Devel.Tests
             var color = new Color("#F1C40F");
             float blurRadius = 5.0f;
 
-            var map = new PropertyMap();
-            map.Add("offset", new PropertyValue(offset));
-            map.Add("color", new PropertyValue(color));
-            map.Add("blurRadius", new PropertyValue((float)blurRadius));
+            using (var map = new PropertyMap())
+            {
+                map.Add("offset", offset);
+                map.Add("color", color);
+                map.Add("blurRadius", (float)blurRadius);
 
-            var shadow = TextMapHelper.GetShadowStruct(map);
+                var shadow = TextMapHelper.GetShadowStruct(map);
+                Assert.AreEqual(blurRadius, shadow.BlurRadius, "Should be equal!");
+                Assert.AreEqual(true, CheckVector2(offset, shadow.Offset), "Should be true!");
+                Assert.AreEqual(true, CheckColor(color, shadow.Color), "Should be true!");
+            }
 
-            Assert.AreEqual(blurRadius, shadow.BlurRadius, "Should be equal!");
-            Assert.AreEqual(true, CheckVector2(offset, shadow.Offset), "Should be true!");
-            Assert.AreEqual(true, CheckColor(color, shadow.Color), "Should be true!");
+            offset.Dispose();
+            color.Dispose();
 
             tlog.Debug(tag, $"TextMapHelperGetShadowStruct END (OK)");
         }
@@ -405,13 +426,16 @@ namespace Tizen.NUI.Devel.Tests
                 Color = new Color("#45B39D"),
             };
 
-            var map = TextMapHelper.GetOutlineMap(outline);
-            var color = new Color();
-            map.Find(0, "color").Get(color);
-            map.Find(0, "width").Get(out float width);
+            using (PropertyMap map = TextMapHelper.GetOutlineMap(outline))
+            {
+                var color = new Color();
+                map.Find(0, "color").Get(color);
+                map.Find(0, "width").Get(out float width);
 
-            Assert.AreEqual(width, outline.Width, "Should be equal!");
-            Assert.AreEqual(true, CheckColor(color, outline.Color), "Should be true!");
+                Assert.AreEqual(width, outline.Width, "Should be equal!");
+                Assert.AreEqual(true, CheckColor(color, outline.Color), "Should be true!");
+                color.Dispose();
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetOutlineMap END (OK)");
         }
@@ -430,13 +454,17 @@ namespace Tizen.NUI.Devel.Tests
             var width = 2.0f;
             var color = new Color("#45B39D");
 
-            var map = new PropertyMap();
-            map.Add("color", new PropertyValue(color));
-            map.Add("width", new PropertyValue((float)width));
+            using (var map = new PropertyMap())
+            {
+                map.Add("color", color);
+                map.Add("width", (float)width);
 
-            var outline = TextMapHelper.GetOutlineStruct(map);
-            Assert.AreEqual(width, outline.Width, "Should be equal!");
-            Assert.AreEqual(true, CheckColor(color, outline.Color), "Should be true!");
+                var outline = TextMapHelper.GetOutlineStruct(map);
+                Assert.AreEqual(width, outline.Width, "Should be equal!");
+                Assert.AreEqual(true, CheckColor(color, outline.Color), "Should be true!");
+            }
+
+            color.Dispose();
 
             tlog.Debug(tag, $"TextMapHelperGetOutlineStruct END (OK)");
         }
@@ -506,18 +534,20 @@ namespace Tizen.NUI.Devel.Tests
                 FontSizeType = FontSizeType.PointSize
             };
 
-            var map = TextMapHelper.GetTextFitMap(textFit);
-            map.Find(0, "enable").Get(out bool enable);
-            map.Find(0, "minSize").Get(out float minSize);
-            map.Find(0, "maxSize").Get(out float maxSize);
-            map.Find(0, "stepSize").Get(out float stepSize);
-            map.Find(0, "fontSizeType").Get(out string fontSizeType);
-
-            Assert.AreEqual(enable, textFit.Enable, "Should be equal!");
-            Assert.AreEqual(minSize, textFit.MinSize, "Should be equal!");
-            Assert.AreEqual(maxSize, textFit.MaxSize, "Should be equal!");
-            Assert.AreEqual(stepSize, textFit.StepSize, "Should be equal!");
-            Assert.AreEqual(fontSizeType, "pointSize", "Should be equal!");
+            using (PropertyMap map = TextMapHelper.GetTextFitMap(textFit))
+            {
+                map.Find(0, "enable").Get(out bool enable);
+                map.Find(0, "minSize").Get(out float minSize);
+                map.Find(0, "maxSize").Get(out float maxSize);
+                map.Find(0, "stepSize").Get(out float stepSize);
+                map.Find(0, "fontSizeType").Get(out string fontSizeType);
+
+                Assert.AreEqual(enable, textFit.Enable, "Should be equal!");
+                Assert.AreEqual(minSize, textFit.MinSize, "Should be equal!");
+                Assert.AreEqual(maxSize, textFit.MaxSize, "Should be equal!");
+                Assert.AreEqual(stepSize, textFit.StepSize, "Should be equal!");
+                Assert.AreEqual(fontSizeType, "pointSize", "Should be equal!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetTextFitMap END (OK)");
         }
@@ -538,20 +568,21 @@ namespace Tizen.NUI.Devel.Tests
             float maxSize = 100.0f;
             float stepSize = 5.0f;
 
-            var map = new PropertyMap();
-            map.Add("enable", new PropertyValue(enable));
-            map.Add("minSize", new PropertyValue((float)minSize));
-            map.Add("maxSize", new PropertyValue((float)maxSize));
-            map.Add("stepSize", new PropertyValue((float)stepSize));
-            map.Add("fontSizeType", new PropertyValue("pointSize"));
-
-            var textFit = TextMapHelper.GetTextFitStruct(map);
-
-            Assert.AreEqual(enable, textFit.Enable, "Should be equal!");
-            Assert.AreEqual(minSize, textFit.MinSize, "Should be equal!");
-            Assert.AreEqual(maxSize, textFit.MaxSize, "Should be equal!");
-            Assert.AreEqual(stepSize, textFit.StepSize, "Should be equal!");
-            Assert.AreEqual(FontSizeType.PointSize, textFit.FontSizeType, "Should be equal!");
+            using (var map = new PropertyMap())
+            {
+                map.Add("enable", enable);
+                map.Add("minSize", (float)minSize);
+                map.Add("maxSize", (float)maxSize);
+                map.Add("stepSize", (float)stepSize);
+                map.Add("fontSizeType", "pointSize");
+
+                var textFit = TextMapHelper.GetTextFitStruct(map);
+                Assert.AreEqual(enable, textFit.Enable, "Should be equal!");
+                Assert.AreEqual(minSize, textFit.MinSize, "Should be equal!");
+                Assert.AreEqual(maxSize, textFit.MaxSize, "Should be equal!");
+                Assert.AreEqual(stepSize, textFit.StepSize, "Should be equal!");
+                Assert.AreEqual(FontSizeType.PointSize, textFit.FontSizeType, "Should be equal!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetTextFitStruct END (OK)");
         }
@@ -591,28 +622,32 @@ namespace Tizen.NUI.Devel.Tests
             float pointSize;
             bool ellipsis = false;
 
-            var map = TextMapHelper.GetPlaceholderMap(placeholder);
-            map.Find(0).Get(out text);
-            map.Find(1).Get(out textFocused);
-            map.Find(2).Get(color);
-            map.Find(3).Get(out fontFamily);
-            map.Find(4).Get(fontStyle);
-            map.Find(5).Get(out pointSize);
-            map.Find(7).Get(out ellipsis);
-
-            fontStyle["width"].Get(out string width);
-            fontStyle["weight"].Get(out string weight);
-            fontStyle["slant"].Get(out string slant);
-
-            Assert.AreEqual(text, placeholder.Text, "Should be equal!");
-            Assert.AreEqual(textFocused, placeholder.TextFocused, "Should be equal!");
-            Assert.AreEqual(true, CheckColor(color, placeholder.Color), "Should be true!");
-            Assert.AreEqual(fontFamily, placeholder.FontFamily, "Should be equal!");
-            Assert.AreEqual(width, "expanded", "Should be equal!");
-            Assert.AreEqual(weight, "bold", "Should be equal!");
-            Assert.AreEqual(slant, "italic", "Should be equal!");
-            Assert.AreEqual(pointSize, placeholder.PointSize, "Should be equal!");
-            Assert.AreEqual(ellipsis, placeholder.Ellipsis, "Should be equal!");
+            using (PropertyMap map = TextMapHelper.GetPlaceholderMap(placeholder))
+            {
+                map.Find(0).Get(out text);
+                map.Find(1).Get(out textFocused);
+                map.Find(2).Get(color);
+                map.Find(3).Get(out fontFamily);
+                map.Find(4).Get(fontStyle);
+                map.Find(5).Get(out pointSize);
+                map.Find(7).Get(out ellipsis);
+                fontStyle.Find(0, "width").Get(out string width);
+                fontStyle.Find(0, "weight").Get(out string weight);
+                fontStyle.Find(0, "slant").Get(out string slant);
+
+                Assert.AreEqual(text, placeholder.Text, "Should be equal!");
+                Assert.AreEqual(textFocused, placeholder.TextFocused, "Should be equal!");
+                Assert.AreEqual(true, CheckColor(color, placeholder.Color), "Should be true!");
+                Assert.AreEqual(fontFamily, placeholder.FontFamily, "Should be equal!");
+                Assert.AreEqual(width, "expanded", "Should be equal!");
+                Assert.AreEqual(weight, "bold", "Should be equal!");
+                Assert.AreEqual(slant, "italic", "Should be equal!");
+                Assert.AreEqual(pointSize, placeholder.PointSize, "Should be equal!");
+                Assert.AreEqual(ellipsis, placeholder.Ellipsis, "Should be equal!");
+            }
+
+            color.Dispose();
+            fontStyle.Dispose();
 
             tlog.Debug(tag, $"TextMapHelperGetPlaceholderMap END (OK)");
         }
@@ -633,32 +668,37 @@ namespace Tizen.NUI.Devel.Tests
             Color color = new Color("#45B39D");
             string fontFamily = "BreezeSans";
             var fontStyle = new PropertyMap();
-            fontStyle.Add("width", new PropertyValue("expanded"));
-            fontStyle.Add("weight", new PropertyValue("bold"));
-            fontStyle.Add("slant", new PropertyValue("italic"));
+            fontStyle.Add("width", "expanded");
+            fontStyle.Add("weight", "bold");
+            fontStyle.Add("slant", "italic");
             float pointSize = 25.0f;
             bool ellipsis = false;
 
-            var map = new PropertyMap();
-            map.Add(0, new PropertyValue(text));
-            map.Add(1, new PropertyValue(textFocused));
-            map.Add(2, new PropertyValue(color));
-            map.Add(3, new PropertyValue(fontFamily));
-            map.Add(4, new PropertyValue(fontStyle));
-            map.Add(5, new PropertyValue((float)pointSize));
-            map.Add(7, new PropertyValue(ellipsis));
-
-            var placeholder = TextMapHelper.GetPlaceholderStruct(map);
-
-            Assert.AreEqual(text, placeholder.Text, "Should be equal!");
-            Assert.AreEqual(textFocused, placeholder.TextFocused, "Should be equal!");
-            Assert.AreEqual(true, CheckColor(color, placeholder.Color), "Should be true!");
-            Assert.AreEqual(fontFamily, placeholder.FontFamily, "Should be equal!");
-            Assert.AreEqual(FontWidthType.Expanded, placeholder.FontStyle?.Width, "Should be equal!");
-            Assert.AreEqual(FontWeightType.Bold, placeholder.FontStyle?.Weight, "Should be equal!");
-            Assert.AreEqual(FontSlantType.Italic, placeholder.FontStyle?.Slant, "Should be equal!");
-            Assert.AreEqual(pointSize, placeholder.PointSize, "Should be equal!");
-            Assert.AreEqual(ellipsis, false, "Should be equal!");
+            using (var map = new PropertyMap())
+            {
+                map.Add(0, text);
+                map.Add(1, textFocused);
+                map.Add(2, color);
+                map.Add(3, fontFamily);
+                map.Add(4, new PropertyValue(fontStyle));
+                map.Add(5, (float)pointSize);
+                map.Add(7, ellipsis);
+
+                var placeholder = TextMapHelper.GetPlaceholderStruct(map);
+
+                Assert.AreEqual(text, placeholder.Text, "Should be equal!");
+                Assert.AreEqual(textFocused, placeholder.TextFocused, "Should be equal!");
+                Assert.AreEqual(true, CheckColor(color, placeholder.Color), "Should be true!");
+                Assert.AreEqual(fontFamily, placeholder.FontFamily, "Should be equal!");
+                Assert.AreEqual(FontWidthType.Expanded, placeholder.FontStyle?.Width, "Should be equal!");
+                Assert.AreEqual(FontWeightType.Bold, placeholder.FontStyle?.Weight, "Should be equal!");
+                Assert.AreEqual(FontSlantType.Italic, placeholder.FontStyle?.Slant, "Should be equal!");
+                Assert.AreEqual(pointSize, placeholder.PointSize, "Should be equal!");
+                Assert.AreEqual(ellipsis, false, "Should be equal!");
+            }
+
+            color.Dispose();
+            fontStyle.Dispose();
 
             tlog.Debug(tag, $"TextMapHelperGetPlaceholderStruct END (OK)");
         }
@@ -682,17 +722,18 @@ namespace Tizen.NUI.Devel.Tests
                 ShowLastCharacterDuration = 1000
             };
 
-            var map = TextMapHelper.GetHiddenInputMap(hiddenInput);
-
-            map.Find(0).Get(out int mode);
-            map.Find(1).Get(out int substituteCharacter);
-            map.Find(2).Get(out int substituteCount);
-            map.Find(3).Get(out int showLastCharacterDuration);
+            using (PropertyMap map = TextMapHelper.GetHiddenInputMap(hiddenInput))
+            {
+                map.Find(0).Get(out int mode);
+                map.Find(1).Get(out int substituteCharacter);
+                map.Find(2).Get(out int substituteCount);
+                map.Find(3).Get(out int showLastCharacterDuration);
 
-            Assert.AreEqual(mode, (int)hiddenInput.Mode, "Should be equal!");
-            Assert.AreEqual(substituteCharacter, Convert.ToInt32(hiddenInput.SubstituteCharacter), "Should be equal!");
-            Assert.AreEqual(substituteCount, hiddenInput.SubstituteCount, "Should be equal!");
-            Assert.AreEqual(showLastCharacterDuration, hiddenInput.ShowLastCharacterDuration, "Should be equal!");
+                Assert.AreEqual(mode, (int)hiddenInput.Mode, "Should be equal!");
+                Assert.AreEqual(substituteCharacter, Convert.ToInt32(hiddenInput.SubstituteCharacter), "Should be equal!");
+                Assert.AreEqual(substituteCount, hiddenInput.SubstituteCount, "Should be equal!");
+                Assert.AreEqual(showLastCharacterDuration, hiddenInput.ShowLastCharacterDuration, "Should be equal!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetHiddenInputMap END (OK)");
         }
@@ -713,18 +754,19 @@ namespace Tizen.NUI.Devel.Tests
             int substituteCount = 0;
             int showLastCharacterDuration = 1000;
 
-            var map = new PropertyMap();
-            map.Add(0, new PropertyValue(mode));
-            map.Add(1, new PropertyValue(substituteCharacter));
-            map.Add(2, new PropertyValue(substituteCount));
-            map.Add(3, new PropertyValue(showLastCharacterDuration));
-
-            var hiddenInput = TextMapHelper.GetHiddenInputStruct(map);
-
-            Assert.AreEqual(mode, (int)hiddenInput.Mode, "Should be equal!");
-            Assert.AreEqual(substituteCharacter, Convert.ToInt32(hiddenInput.SubstituteCharacter), "Should be equal!");
-            Assert.AreEqual(substituteCount, hiddenInput.SubstituteCount, "Should be equal!");
-            Assert.AreEqual(showLastCharacterDuration, hiddenInput.ShowLastCharacterDuration, "Should be equal!");
+            using (var map = new PropertyMap())
+            {
+                map.Add(0, mode);
+                map.Add(1, substituteCharacter);
+                map.Add(2, substituteCount);
+                map.Add(3, showLastCharacterDuration);
+
+                var hiddenInput = TextMapHelper.GetHiddenInputStruct(map);
+                Assert.AreEqual(mode, (int)hiddenInput.Mode, "Should be equal!");
+                Assert.AreEqual(substituteCharacter, Convert.ToInt32(hiddenInput.SubstituteCharacter), "Should be equal!");
+                Assert.AreEqual(substituteCount, hiddenInput.SubstituteCount, "Should be equal!");
+                Assert.AreEqual(showLastCharacterDuration, hiddenInput.ShowLastCharacterDuration, "Should be equal!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetHiddenInputStruct END (OK)");
         }
@@ -742,10 +784,11 @@ namespace Tizen.NUI.Devel.Tests
 
             string url = "filePath";
 
-            var map = TextMapHelper.GetFileNameMap(url);
-            map.Find(0, "filename").Get(out string fileName);
-
-            Assert.AreEqual(url, fileName, "Should be equal!");
+            using (PropertyMap map = TextMapHelper.GetFileNameMap(url))
+            {
+                map.Find(0, "filename").Get(out string fileName);
+                Assert.AreEqual(url, fileName, "Should be equal!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetFileNameMap END (OK)");
         }
@@ -764,13 +807,14 @@ namespace Tizen.NUI.Devel.Tests
             string leftImageUrl = "leftImageUrl";
             string rightImageUrl = "rightImageUrl";
 
-            var leftImageMap = new PropertyMap().Add("filename", new PropertyValue(leftImageUrl));
-            var rightImageMap = new PropertyMap().Add("filename", new PropertyValue(rightImageUrl));
-
-            var selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
+            using (var leftImageMap = new PropertyMap().Add("filename", leftImageUrl))
+            using (var rightImageMap = new PropertyMap().Add("filename", rightImageUrl))
+            {
+                var selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
 
-            Assert.AreEqual(leftImageUrl, selectionHandleImage.LeftImageUrl, "Should be equal!");
-            Assert.AreEqual(rightImageUrl, selectionHandleImage.RightImageUrl, "Should be equal!");
+                Assert.AreEqual(leftImageUrl, selectionHandleImage.LeftImageUrl, "Should be equal!");
+                Assert.AreEqual(rightImageUrl, selectionHandleImage.RightImageUrl, "Should be equal!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetSelectionHandleImageStruct END (OK)");
         }
@@ -818,21 +862,23 @@ namespace Tizen.NUI.Devel.Tests
             var value = "expanded";
             var defaultValue = "none";
 
-            var map = new PropertyMap();
-            map.Add(stringKey, new PropertyValue(value));
-            map.Add(intKey, new PropertyValue(value));
+            using (var map = new PropertyMap())
+            {
+                map.Add(stringKey, value);
+                map.Add(intKey, value);
 
-            var result = TextMapHelper.GetStringFromMap(map, stringKey, defaultValue);
-            Assert.AreEqual(value, result, "Should be equal!");
+                var result = TextMapHelper.GetStringFromMap(map, stringKey, defaultValue);
+                Assert.AreEqual(value, result, "Should be equal!");
 
-            result = TextMapHelper.GetStringFromMap(map, stringInvalidKey, defaultValue);
-            Assert.AreEqual(defaultValue, result, "Should be equal!");
+                result = TextMapHelper.GetStringFromMap(map, stringInvalidKey, defaultValue);
+                Assert.AreEqual(defaultValue, result, "Should be equal!");
 
-            result = TextMapHelper.GetStringFromMap(map, intKey, defaultValue);
-            Assert.AreEqual(value, result, "Should be equal!");
+                result = TextMapHelper.GetStringFromMap(map, intKey, defaultValue);
+                Assert.AreEqual(value, result, "Should be equal!");
 
-            result = TextMapHelper.GetStringFromMap(map, intInvalidKey, defaultValue);
-            Assert.AreEqual(defaultValue, result, "Should be equal!");
+                result = TextMapHelper.GetStringFromMap(map, intInvalidKey, defaultValue);
+                Assert.AreEqual(defaultValue, result, "Should be equal!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetStringFromMap END (OK)");
         }
@@ -855,21 +901,23 @@ namespace Tizen.NUI.Devel.Tests
             var value = true;
             var defaultValue = false;
 
-            var map = new PropertyMap();
-            map.Add(stringKey, new PropertyValue(value));
-            map.Add(intKey, new PropertyValue(value));
+            using (var map = new PropertyMap())
+            {
+                map.Add(stringKey, value);
+                map.Add(intKey, value);
 
-            var result = TextMapHelper.GetBoolFromMap(map, stringKey, defaultValue);
-            Assert.AreEqual(value, result, "Should be equal!");
+                var result = TextMapHelper.GetBoolFromMap(map, stringKey, defaultValue);
+                Assert.AreEqual(value, result, "Should be equal!");
 
-            result = TextMapHelper.GetBoolFromMap(map, stringInvalidKey, defaultValue);
-            Assert.AreEqual(defaultValue, result, "Should be equal!");
+                result = TextMapHelper.GetBoolFromMap(map, stringInvalidKey, defaultValue);
+                Assert.AreEqual(defaultValue, result, "Should be equal!");
 
-            result = TextMapHelper.GetBoolFromMap(map, intKey, defaultValue);
-            Assert.AreEqual(value, result, "Should be equal!");
+                result = TextMapHelper.GetBoolFromMap(map, intKey, defaultValue);
+                Assert.AreEqual(value, result, "Should be equal!");
 
-            result = TextMapHelper.GetBoolFromMap(map, intInvalidKey, defaultValue);
-            Assert.AreEqual(defaultValue, result, "Should be equal!");
+                result = TextMapHelper.GetBoolFromMap(map, intInvalidKey, defaultValue);
+                Assert.AreEqual(defaultValue, result, "Should be equal!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetBoolFromMap END (OK)");
         }
@@ -890,14 +938,16 @@ namespace Tizen.NUI.Devel.Tests
             var value = 3080;
             var defaultValue = 0;
 
-            var map = new PropertyMap();
-            map.Add(intKey, new PropertyValue(value));
+            using (var map = new PropertyMap())
+            {
+                map.Add(intKey, value);
 
-            var result = TextMapHelper.GetIntFromMap(map, intKey, defaultValue);
-            Assert.AreEqual(value, result, "Should be equal!");
+                var result = TextMapHelper.GetIntFromMap(map, intKey, defaultValue);
+                Assert.AreEqual(value, result, "Should be equal!");
 
-            result = TextMapHelper.GetIntFromMap(map, intInvalidKey, defaultValue);
-            Assert.AreEqual(defaultValue, result, "Should be equal!");
+                result = TextMapHelper.GetIntFromMap(map, intInvalidKey, defaultValue);
+                Assert.AreEqual(defaultValue, result, "Should be equal!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetIntFromMap END (OK)");
         }
@@ -918,14 +968,16 @@ namespace Tizen.NUI.Devel.Tests
             float value = 3.14f;
             float defaultValue = 0.0f;
 
-            var map = new PropertyMap();
-            map.Add(stringKey, new PropertyValue(value));
+            using (var map = new PropertyMap())
+            {
+                map.Add(stringKey, value);
 
-            var result = TextMapHelper.GetFloatFromMap(map, stringKey, defaultValue);
-            Assert.AreEqual(value, result, "Should be equal!");
+                var result = TextMapHelper.GetFloatFromMap(map, stringKey, defaultValue);
+                Assert.AreEqual(value, result, "Should be equal!");
 
-            result = TextMapHelper.GetFloatFromMap(map, stringInvalidKey, defaultValue);
-            Assert.AreEqual(defaultValue, result, "Should be equal!");
+                result = TextMapHelper.GetFloatFromMap(map, stringInvalidKey, defaultValue);
+                Assert.AreEqual(defaultValue, result, "Should be equal!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetFloatFromMap END (OK)");
         }
@@ -946,15 +998,17 @@ namespace Tizen.NUI.Devel.Tests
             var intKey = 1;
             var value = new Color(1.0f, 0.2f, 0.5f, 1.0f);
 
-            var map = new PropertyMap();
-            map.Add(stringKey, new PropertyValue(value));
-            map.Add(intKey, new PropertyValue(value));
+            using (var map = new PropertyMap())
+            {
+                map.Add(stringKey, value);
+                map.Add(intKey, value);
 
-            var result = TextMapHelper.GetColorFromMap(map, stringKey);
-            Assert.AreEqual(true, CheckColor(value, result), "Should be true!");
+                var result = TextMapHelper.GetColorFromMap(map, stringKey);
+                Assert.AreEqual(true, CheckColor(value, result), "Should be true!");
 
-            result = TextMapHelper.GetColorFromMap(map, intKey);
-            Assert.AreEqual(true, CheckColor(value, result), "Should be true!");
+                result = TextMapHelper.GetColorFromMap(map, intKey);
+                Assert.AreEqual(true, CheckColor(value, result), "Should be true!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetColorFromMap END (OK)");
         }
@@ -974,11 +1028,13 @@ namespace Tizen.NUI.Devel.Tests
             var stringInvalidKey = "invalidKey";
             var value = new Vector2(3, 10);
 
-            var map = new PropertyMap();
-            map.Add(stringKey, new PropertyValue(value));
+            using (var map = new PropertyMap())
+            {
+                map.Add(stringKey, value);
 
-            var result = TextMapHelper.GetVector2FromMap(map, stringKey);
-            Assert.AreEqual(true, CheckVector2(value, result), "Should be true!");
+                var result = TextMapHelper.GetVector2FromMap(map, stringKey);
+                Assert.AreEqual(true, CheckVector2(value, result), "Should be true!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetVector2FromMap END (OK)");
         }
@@ -996,17 +1052,19 @@ namespace Tizen.NUI.Devel.Tests
 
             var intKey = 1;
             var value = new PropertyMap();
-            value.Add("width", new PropertyValue(10));
-            value.Add("height", new PropertyValue(20));
+            value.Add("width", 10);
+            value.Add("height", 20);
 
-            var map = new PropertyMap();
-            map.Add(intKey, new PropertyValue(value));
+            using (var map = new PropertyMap())
+            {
+                map.Add(intKey, new PropertyValue(value));
 
-            var result = TextMapHelper.GetMapFromMap(map, intKey);
-            result.Find(0, "width").Get(out int width);
-            result.Find(0, "height").Get(out int height);
-            Assert.AreEqual(10, width, "Should be equal!");
-            Assert.AreEqual(20, height, "Should be equal!");
+                var result = TextMapHelper.GetMapFromMap(map, intKey);
+                result.Find(0, "width").Get(out int width);
+                result.Find(0, "height").Get(out int height);
+                Assert.AreEqual(10, width, "Should be equal!");
+                Assert.AreEqual(20, height, "Should be equal!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetMapFromMap END (OK)");
         }
@@ -1027,14 +1085,16 @@ namespace Tizen.NUI.Devel.Tests
             int value = 3080;
             int? result = null;
 
-            var map = new PropertyMap();
-            map.Add(intKey, new PropertyValue(value));
+            using (var map = new PropertyMap())
+            {
+                map.Add(intKey, value);
 
-            result = TextMapHelper.GetNullableIntFromMap(map, intKey);
-            Assert.AreEqual(value, result, "Should be equal!");
+                result = TextMapHelper.GetNullableIntFromMap(map, intKey);
+                Assert.AreEqual(value, result, "Should be equal!");
 
-            result = TextMapHelper.GetNullableIntFromMap(map, intInvalidKey);
-            Assert.AreEqual(null, result, "Should be equal!");
+                result = TextMapHelper.GetNullableIntFromMap(map, intInvalidKey);
+                Assert.AreEqual(null, result, "Should be equal!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetNullableIntFromMap END (OK)");
         }
@@ -1055,14 +1115,16 @@ namespace Tizen.NUI.Devel.Tests
             float value = 3.14f;
             float? result = null;
 
-            var map = new PropertyMap();
-            map.Add(intKey, new PropertyValue(value));
+            using (var map = new PropertyMap())
+            {
+                map.Add(intKey, value);
 
-            result = TextMapHelper.GetNullableFloatFromMap(map, intKey);
-            Assert.AreEqual(value, result, "Should be equal!");
+                result = TextMapHelper.GetNullableFloatFromMap(map, intKey);
+                Assert.AreEqual(value, result, "Should be equal!");
 
-            result = TextMapHelper.GetNullableFloatFromMap(map, intInvalidKey);
-            Assert.AreEqual(null, result, "Should be equal!");
+                result = TextMapHelper.GetNullableFloatFromMap(map, intInvalidKey);
+                Assert.AreEqual(null, result, "Should be equal!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperGetNullableFloatFromMap END (OK)");
         }
@@ -1082,14 +1144,16 @@ namespace Tizen.NUI.Devel.Tests
             var intInvalidKey = 10;
             var value = "value";
             
-            var map = new PropertyMap();
-            map.Add(intKey, new PropertyValue(value));
+            using (var map = new PropertyMap())
+            {
+                map.Add(intKey, value);
 
-            var result = TextMapHelper.IsValue(map, intKey);
-            Assert.AreEqual(true, result, "Should be true!");
+                var result = TextMapHelper.IsValue(map, intKey);
+                Assert.AreEqual(true, result, "Should be true!");
 
-            result = TextMapHelper.IsValue(map, intInvalidKey);
-            Assert.AreEqual(false, result, "Should be false!");
+                result = TextMapHelper.IsValue(map, intInvalidKey);
+                Assert.AreEqual(false, result, "Should be false!");
+            }
 
             tlog.Debug(tag, $"TextMapHelperIsValue END (OK)");
         }