예제 #1
0
        public void PropertyMapMerge()
        {
            tlog.Debug(tag, $"PropertyMapMerge START");

            var testingTarget = new PropertyMap();
            Assert.IsNotNull(testingTarget, "should not be null.");
            Assert.IsInstanceOf<PropertyMap>(testingTarget, "should be an instance of PropertyMap class!");

            var dummyValue1 = new PropertyValue(5);
            Assert.IsNotNull(dummyValue1, "should not be null.");
            Assert.IsInstanceOf<PropertyValue>(dummyValue1, "should be an instance of PropertyValue class!");
            testingTarget.Add(100, dummyValue1);

            var dummy = new PropertyMap();
            Assert.IsNotNull(dummy, "should not be null.");
            Assert.IsInstanceOf<PropertyMap>(dummy, "should be an instance of PropertyMap class!");

            var dummyValue2 = new PropertyValue(6);
            Assert.IsNotNull(dummyValue2, "should not be null.");
            Assert.IsInstanceOf<PropertyValue>(dummyValue2, "should be an instance of PropertyValue class!");
            dummy.Add("A", dummyValue2);

            testingTarget.Merge(dummy);
            Assert.AreEqual(2, testingTarget.Count(), "Retrive dummy1.Count() should equal to 2.");

            dummyValue2.Dispose();
            dummy.Dispose();
            dummyValue1.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"PropertyMapMerge END (OK)");
        }
예제 #2
0
        public void PropertyValueConstructorWithPropertyArray()
        {
            tlog.Debug(tag, $"PropertyValueConstructorWithPropertyArray START");

            PropertyArray dummy_array = new PropertyArray();

            Assert.IsNotNull(dummy_array, "Should be not null!");
            Assert.IsInstanceOf <PropertyArray>(dummy_array, "Should return PropertyArray instance.");

            PropertyValue dummy_value1 = new PropertyValue(14.0f);

            Assert.IsNotNull(dummy_value1, "Should be not null!");
            Assert.IsInstanceOf <PropertyValue>(dummy_value1, "Should return PropertyValue instance.");

            PropertyValue dummy_value2 = new PropertyValue(15.0f);

            Assert.IsNotNull(dummy_value2, "Should be not null!");
            Assert.IsInstanceOf <PropertyValue>(dummy_value2, "Should return PropertyValue instance.");

            dummy_array.Add(dummy_value1);
            dummy_array.Add(dummy_value2);

            var testingTarget = new PropertyValue(dummy_array);

            Assert.IsNotNull(testingTarget, "Should be not null!");
            Assert.IsInstanceOf <PropertyValue>(testingTarget, "Should return PropertyValue instance.");

            testingTarget.Dispose();
            dummy_value2.Dispose();
            dummy_value1.Dispose();
            dummy_array.Dispose();

            tlog.Debug(tag, $"PropertyValueConstructorWithPropertyArray END (OK)");
        }
예제 #3
0
        public void PropertyMapFindWithIntAndStringKey()
        {
            tlog.Debug(tag, $"PropertyMapFindWithIntAndStringKey START");

            var testingTarget = new PropertyMap();

            Assert.IsNotNull(testingTarget, "should not be null.");
            Assert.IsInstanceOf <PropertyMap>(testingTarget, "should be an instance of PropertyMap class!");

            var dummy = new PropertyValue("DALI");

            Assert.IsNotNull(dummy, "should not be null.");
            Assert.IsInstanceOf <PropertyValue>(dummy, "should be an instance of PropertyValue class!");

            testingTarget.Add("A", dummy);
            PropertyValue value  = testingTarget.Find(10, "A");
            string        result = "";

            value.Get(out result);
            Assert.AreEqual("DALI", result, "Retrive result should equal to the set value.");

            dummy.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"PropertyMapFindWithIntAndStringKey END (OK)");
        }
예제 #4
0
        public void PropertyMapEmpty()
        {
            tlog.Debug(tag, $"PropertyMapEmpty START");

            var testingTarget = new PropertyMap();
            Assert.IsNotNull(testingTarget, "should not be null.");
            Assert.IsInstanceOf<PropertyMap>(testingTarget, "should be an instance of PropertyMap class!");
            
            Assert.True(testingTarget.Empty(), "the testingTarget is empty");

            var dummy1 = new PropertyValue(4.0f);
            Assert.IsNotNull(dummy1, "should not be null.");
            Assert.IsInstanceOf<PropertyValue>(dummy1, "should be an instance of PropertyValue class!");

            testingTarget.Insert(8, dummy1);

            var dummy2 = new PropertyValue(5.0f);
            Assert.IsNotNull(dummy2, "should not be null.");
            Assert.IsInstanceOf<PropertyValue>(dummy2, "should be an instance of PropertyValue class!");

            testingTarget.Insert(18, dummy2);
            
            Assert.False(testingTarget.Empty(), "the PropertyMap is not empty");

            dummy1.Dispose();
            dummy2.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"PropertyMapEmpty END (OK)");
        }
예제 #5
0
        public void PropertyValueGetRotationValue()
        {
            tlog.Debug(tag, $"PropertyValueGetRotationValue START");

            var dummy = new Rotation(new Radian(6.0f), new Vector3(1.0f, 2.0f, 3.0f));

            Assert.IsNotNull(dummy, "Should be not null!");
            Assert.IsInstanceOf <Rotation>(dummy, "Should be an Instance of Rotation class!");

            var testingTarget = new PropertyValue(dummy);

            Assert.IsNotNull(testingTarget, "Should be not null!");
            Assert.IsInstanceOf <PropertyValue>(testingTarget, "Should be an Instance of PropertyValue class!");

            Rotation rotation = new Rotation();
            var      result   = testingTarget.Get(rotation);

            Assert.IsTrue(result);

            Radian  angle = new Radian(20.0f);
            Vector3 axis  = new Vector3(0, 0, 0);

            rotation.GetAxisAngle(axis, angle);
            Assert.AreEqual(0.27f, float.Parse(axis.X.ToString("F2")), "shoule be equal.");
            Assert.AreEqual(0.53f, float.Parse(axis.Y.ToString("F2")), "shoule be equal.");
            Assert.AreEqual(0.80f, float.Parse(axis.Z.ToString("F2")), "shoule be equal.");

            testingTarget.Dispose();
            rotation.Dispose();
            dummy.Dispose();
            tlog.Debug(tag, $"PropertyValueGetRotationValue END (OK)");
        }
예제 #6
0
        /// <summary>
        /// Compose the out visual map.
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        protected override void ComposingPropertyMap()
        {
            if (url != null)
            {
                _outputVisualMap = new PropertyMap();
                PropertyValue temp = new PropertyValue((int)Visual.Type.NPatch);
                _outputVisualMap.Add(Visual.Property.Type, temp);
                temp.Dispose();

                temp = new PropertyValue(url);
                _outputVisualMap.Add(NpatchImageVisualProperty.URL, temp);
                temp.Dispose();

                if (borderOnly != null)
                {
                    temp = new PropertyValue((bool)borderOnly);
                    _outputVisualMap.Add(NpatchImageVisualProperty.BorderOnly, temp);
                    temp.Dispose();
                }

                if (border != null)
                {
                    temp = new PropertyValue(border);
                    _outputVisualMap.Add(NpatchImageVisualProperty.Border, temp);
                    temp.Dispose();
                }
                base.ComposingPropertyMap();
            }
        }
예제 #7
0
        public void PropertyMapCount()
        {
            tlog.Debug(tag, $"PropertyMapCount START");

            var testingTarget = new PropertyMap();
            Assert.IsNotNull(testingTarget, "should not be null.");
            Assert.IsInstanceOf<PropertyMap>(testingTarget, "should be an instance of PropertyMap class!");

            var dummy1 = new PropertyValue(4.0f);
            Assert.IsNotNull(dummy1, "should not be null.");
            Assert.IsInstanceOf<PropertyValue>(dummy1, "should be an instance of PropertyValue class!");

            testingTarget.Insert(8, dummy1);
            
            var dummy2 = new PropertyValue(5.0f);
            Assert.IsNotNull(dummy2, "should not be null.");
            Assert.IsInstanceOf<PropertyValue>(dummy2, "should be an instance of PropertyValue class!");

            testingTarget.Insert(18, dummy2);
            Assert.AreEqual(2, testingTarget.Count(), "Retrive testingTarget.Count() should equal to 2.");

            dummy1.Dispose();
            dummy2.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"PropertyMapCount END (OK)");
        }
예제 #8
0
        public void KeyFramesAddWithPropertyValueAndAlphaFunc()
        {
            tlog.Debug(tag, $"KeyFramesAddWithPropertyValueAndAlphaFunc START");

            var testingTarget = new KeyFrames();

            Assert.IsNotNull(testingTarget, "should be not null");
            Assert.IsInstanceOf <KeyFrames>(testingTarget, "should be an instance of KeyFrames class!");

            PropertyValue dummy = new PropertyValue(true);
            AlphaFunction ease  = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseOut);

            try
            {
                testingTarget.Add(0.3f, dummy, ease);
                Assert.IsTrue("Boolean" == testingTarget.GetType().ToString());
            }
            catch (Exception e)
            {
                tlog.Error(tag, "Caught Exception" + e.ToString());
                LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
                Assert.Fail("Caught Exception" + e.ToString());
            }

            dummy.Dispose();
            ease.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"KeyFramesAddWithPropertyValueAndAlphaFunc END (OK)");
        }
예제 #9
0
        public void PropertyValueGetPropertyArrayValue()
        {
            tlog.Debug(tag, $"PropertyValueGetPropertyArrayValue START");

            PropertyArray propertyArray = new PropertyArray();

            propertyArray.Add(new PropertyValue(3.0f));

            PropertyValue propertyValue = new PropertyValue(propertyArray);

            var testingTarget = new PropertyArray();

            Assert.IsNotNull(testingTarget, "Should be not null!");
            Assert.IsInstanceOf <PropertyArray>(testingTarget, "Should be an Instance of PropertyArray class!");

            var result = propertyValue.Get(testingTarget);

            Assert.IsTrue(result);

            float temp = 0.0f;

            testingTarget[0].Get(out temp);
            Assert.AreEqual(3.0f, temp, "should be equal.");

            testingTarget.Dispose();
            propertyValue.Dispose();
            propertyArray.Dispose();
            tlog.Debug(tag, $"PropertyValueGetPropertyArrayValue END (OK)");
        }
예제 #10
0
        /// <summary>
        /// Compose the out visual map.
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        protected override void ComposingPropertyMap()
        {
            if (color != null && size != null)
            {
                _outputVisualMap = new PropertyMap();
                PropertyValue temp = new PropertyValue((int)Visual.Type.Border);
                _outputVisualMap.Add(Visual.Property.Type, temp);
                temp.Dispose();

                temp = new PropertyValue((float)size);
                _outputVisualMap.Add(BorderVisualProperty.Size, temp);
                temp.Dispose();

                temp = new PropertyValue(color);
                _outputVisualMap.Add(BorderVisualProperty.Color, temp);
                temp.Dispose();

                if (antiAliasing != null)
                {
                    temp = new PropertyValue((bool)antiAliasing);
                    _outputVisualMap.Add(BorderVisualProperty.AntiAliasing, temp);
                    temp.Dispose();
                }
                base.ComposingPropertyMap();
            }
        }
예제 #11
0
        public void Pause()
        {
            PropertyValue attributes = new PropertyValue(0);

            this.DoAction(imageVisual.VisualIndex, Property.ACTION_PAUSE, attributes);
            attributes.Dispose();
        }
예제 #12
0
        public void PropertyMapInsertKeyWithString()
        {
            tlog.Debug(tag, $"PropertyMapInsertKeyWithString START");

            var testingTarget = new PropertyMap();

            Assert.IsNotNull(testingTarget, "should not be null.");
            Assert.IsInstanceOf <PropertyMap>(testingTarget, "should be an instance of PropertyMap class!");

            var dummy = new PropertyValue(14.0f);

            Assert.IsNotNull(dummy, "should not be null.");
            Assert.IsInstanceOf <PropertyValue>(dummy, "should be an instance of PropertyValue class!");

            testingTarget.Insert("A", dummy);
            PropertyValue value  = testingTarget["A"];
            float         result = 0;

            value.Get(out result);
            Assert.IsTrue(result == 14);

            dummy.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"PropertyMapInsertKeyWithString END (OK)");
        }
예제 #13
0
        public void PropertyValueGetPropertyMapValue()
        {
            tlog.Debug(tag, $"PropertyValueGetPropertyMapValue START");

            var dummy = new PropertyMap();

            Assert.IsNotNull(dummy, "Should be not null!");
            Assert.IsInstanceOf <PropertyMap>(dummy, "Should be an Instance of PropertyMap class!");
            dummy.Add(2, new PropertyValue(400.0f));

            var testingTarget = new PropertyValue(dummy);

            Assert.IsNotNull(testingTarget, "Should be not null!");
            Assert.IsInstanceOf <PropertyValue>(testingTarget, "Should be an Instance of PropertyValue class!");

            PropertyMap propertyMap = new PropertyMap();
            var         result      = testingTarget.Get(propertyMap);

            Assert.IsTrue(result);

            PropertyValue propertyValue = propertyMap[2];
            float         temp          = 0.0f;

            propertyValue.Get(out temp);
            Assert.AreEqual(400.0f, temp, "should be equal.");

            testingTarget.Dispose();
            dummy.Dispose();
            tlog.Debug(tag, $"PropertyValueGetPropertyMapValue END (OK)");
        }
예제 #14
0
        public void Stop()
        {
            PropertyValue attributes = new PropertyValue(0);

            this.DoAction(imageVisual.VisualIndex, Property.ActionStop, attributes);
            attributes.Dispose();
        }
예제 #15
0
        public void SetValues()
        {
            if (mDirtyFlag == false)
            {
                return;
            }
            mDirtyFlag = false;

            PropertyMap   tMap           = new PropertyMap();
            PropertyValue animatiedImage = new PropertyValue((int)Visual.Type.AnimatedImage);

            tMap.Insert(Visual.Property.Type, animatiedImage);
            if (mResourceURLs?.Count != 0)
            {
                PropertyArray mArray      = new PropertyArray();
                PropertyArray returnedArr = new PropertyArray();
                PropertyValue index       = new PropertyValue();
                foreach (var iter in mResourceURLs)
                {
                    index       = new PropertyValue(iter);
                    returnedArr = mArray.Add(index);
                }
                index.Dispose();
                returnedArr.Dispose();
                PropertyValue array = new PropertyValue(mArray);
                tMap.Insert(ImageVisualProperty.URL, array);
                PropertyValue batchSize = new PropertyValue(mBatchSize);
                tMap.Insert(ImageVisualProperty.BatchSize, batchSize);
                PropertyValue cacheSize = new PropertyValue(mCacheSize);
                tMap.Insert(ImageVisualProperty.CacheSize, cacheSize);
                PropertyValue frameDelay = new PropertyValue(mFrameDelay);
                tMap.Insert(ImageVisualProperty.FrameDelay, frameDelay);
                PropertyValue loopCount = new PropertyValue(mLoopCount);
                tMap.Insert(ImageVisualProperty.LoopCount, loopCount);

                loopCount.Dispose();
                frameDelay.Dispose();
                cacheSize.Dispose();
                batchSize.Dispose();
                mArray.Dispose();
                array.Dispose();
            }
            else
            {
                PropertyValue url = new PropertyValue(mUrl);
                tMap.Insert(ImageVisualProperty.URL, url);
                url.Dispose();
            }

            mMap = tMap;
            PropertyValue map = new PropertyValue(mMap);

            SetProperty(ImageView.Property.IMAGE, map);
            map.Dispose();

            tMap.Dispose();
            animatiedImage.Dispose();
        }
예제 #16
0
        public void PropertyValueConstructorWithRectangle()
        {
            tlog.Debug(tag, $"PropertyValueConstructorWithRectangle START");

            var testingTarget = new PropertyValue(new Rectangle(1, 2, 100, 200));

            Assert.IsNotNull(testingTarget, "Should be not null!");
            Assert.IsInstanceOf <PropertyValue>(testingTarget, "Should return PropertyValue instance.");

            testingTarget.Dispose();
            tlog.Debug(tag, $"PropertyValueConstructorWithRectangle END (OK)");
        }
예제 #17
0
        public void PropertyValueConstructorWithVector4()
        {
            tlog.Debug(tag, $"PropertyValueConstructorWithVector4 START");

            var testingTarget = new PropertyValue(new Vector4(1.0f, 2.0f, 3.0f, 4.0f));

            Assert.IsNotNull(testingTarget, "Should be not null!");
            Assert.IsInstanceOf <PropertyValue>(testingTarget, "Should return PropertyValue instance.");

            testingTarget.Dispose();
            tlog.Debug(tag, $"PropertyValueConstructorWithVector4 END (OK)");
        }
예제 #18
0
        public void PropertyValueConstructorWithFoloat()
        {
            tlog.Debug(tag, $"PropertyValueConstructorWithFoloat START");

            var testingTarget = new PropertyValue(6.0f);

            Assert.IsNotNull(testingTarget, "Should be not null!");
            Assert.IsInstanceOf <PropertyValue>(testingTarget, "Should return PropertyValue instance.");

            testingTarget.Dispose();
            tlog.Debug(tag, $"PropertyValueConstructorWithFoloat END (OK)");
        }
예제 #19
0
        public void PropertyValueConstructorWithExtents()
        {
            tlog.Debug(tag, $"PropertyValueConstructorWithExtents START");

            var testingTarget = new PropertyValue(new Extents(1, 2, 3, 4));

            Assert.IsNotNull(testingTarget, "Should be not null!");
            Assert.IsInstanceOf <PropertyValue>(testingTarget, "Should return PropertyValue instance.");

            testingTarget.Dispose();
            tlog.Debug(tag, $"PropertyValueConstructorWithExtents END (OK)");
        }
예제 #20
0
 /// <summary>
 /// Compose the out visual map.
 /// </summary>
 /// <since_tizen> 3 </since_tizen>
 protected override void ComposingPropertyMap()
 {
     if (url != null)
     {
         _outputVisualMap = new PropertyMap();
         PropertyValue temp = new PropertyValue((int)Visual.Type.SVG);
         _outputVisualMap.Add(Visual.Property.Type, temp);
         temp.Dispose();
         temp = new PropertyValue(url);
         _outputVisualMap.Add(ImageVisualProperty.URL, temp);
         temp.Dispose();
         base.ComposingPropertyMap();
     }
 }
예제 #21
0
        public void PropertyValueConstructorWithAngleAxis()
        {
            tlog.Debug(tag, $"PropertyValueConstructorWithAngleAxis START");

            using (AngleAxis angleAxis = new AngleAxis())
            {
                var testingTarget = new PropertyValue(angleAxis);
                Assert.IsNotNull(testingTarget, "Should be not null!");
                Assert.IsInstanceOf <PropertyValue>(testingTarget, "Should return PropertyValue instance.");

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"PropertyValueConstructorWithAngleAxis END (OK)");
        }
예제 #22
0
        public void PropertyValueConstructorWithMatrix()
        {
            tlog.Debug(tag, $"PropertyValueConstructorWithMatrix START");

            using (Matrix matrix = new Matrix())
            {
                var testingTarget = new PropertyValue(matrix);
                Assert.IsNotNull(testingTarget, "Should be not null!");
                Assert.IsInstanceOf <PropertyValue>(testingTarget, "Should return PropertyValue instance.");

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"PropertyValueConstructorWithMatrix END (OK)");
        }
예제 #23
0
파일: MeshVisual.cs 프로젝트: upple/TizenFX
        /// <summary>
        /// Compose the out visual map.
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        protected override void ComposingPropertyMap()
        {
            if (_objectURL != null)
            {
                _outputVisualMap = new PropertyMap();
                PropertyValue temp = new PropertyValue((int)Visual.Type.Mesh);
                _outputVisualMap.Add(Visual.Property.Type, temp);
                temp.Dispose();

                temp = new PropertyValue(_objectURL);
                _outputVisualMap.Add(MeshVisualProperty.ObjectURL, temp);
                temp.Dispose();

                if (_materialtURL != null)
                {
                    temp = new PropertyValue(_materialtURL);
                    _outputVisualMap.Add(MeshVisualProperty.MaterialtURL, temp);
                    temp.Dispose();
                }
                if (_texturesPath != null)
                {
                    temp = new PropertyValue(_texturesPath);
                    _outputVisualMap.Add(MeshVisualProperty.TexturesPath, temp);
                    temp.Dispose();
                }
                if (_shadingMode != null)
                {
                    temp = new PropertyValue((int)_shadingMode);
                    _outputVisualMap.Add(MeshVisualProperty.ShadingMode, temp);
                    temp.Dispose();
                }
                if (_useMipmapping != null)
                {
                    temp = new PropertyValue((bool)_useMipmapping);
                    _outputVisualMap.Add(MeshVisualProperty.UseMipmapping, temp);
                    temp.Dispose();
                }
                if (_useSoftNormals != null)
                {
                    temp = new PropertyValue((bool)_useSoftNormals);
                    _outputVisualMap.Add(MeshVisualProperty.UseSoftNormals, temp);
                    temp.Dispose();
                }
                base.ComposingPropertyMap();
            }
        }
예제 #24
0
        public void PropertyValueGetPropertyStringValue()
        {
            tlog.Debug(tag, $"PropertyValueGetPropertyStringValue START");

            var testingTarget = new PropertyValue("DALI");

            Assert.IsNotNull(testingTarget, "Should be not null!");
            Assert.IsInstanceOf <PropertyValue>(testingTarget, "Should be an Instance of PropertyValue class!");

            string result = "";

            testingTarget.Get(out result);
            Assert.AreEqual("DALI", result, "should be equal.");

            testingTarget.Dispose();
            tlog.Debug(tag, $"PropertyValueGetPropertyStringValue END (OK)");
        }
예제 #25
0
        public void PropertyValueGetIntegerValue()
        {
            tlog.Debug(tag, $"PropertyValueGetIntegerValue START");

            var testingTarget = new PropertyValue(20);

            Assert.IsNotNull(testingTarget, "Should be not null!");
            Assert.IsInstanceOf <PropertyValue>(testingTarget, "should be an Instance of PropertyValue class.");

            int result = 0;

            testingTarget.Get(out result);
            Assert.IsTrue(20 == result);

            testingTarget.Dispose();
            tlog.Debug(tag, $"PropertyValueGetIntegerValue END (OK)");
        }
예제 #26
0
        public void PropertyValueGetType()
        {
            tlog.Debug(tag, $"PropertyValueGetType START");

            var dummy = new PropertyValue(2);

            Assert.IsNotNull(dummy, "Should be not null!");
            Assert.IsInstanceOf <PropertyValue>(dummy, "should be an Instance of PropertyValue class.");

            var testingTarget = dummy.GetType();

            Assert.IsNotNull(testingTarget, "Should be not null!");
            Assert.AreEqual(PropertyType.Integer, testingTarget, "should be equal.");

            dummy.Dispose();
            tlog.Debug(tag, $"PropertyValueGetType END (OK)");
        }
예제 #27
0
        public void PropertyValueConstructorWithPropertyValue()
        {
            tlog.Debug(tag, $"PropertyValueConstructorWithPropertyValue START");

            var dummy = new PropertyValue(5);

            Assert.IsNotNull(dummy, "Should be not null!");
            Assert.IsInstanceOf <PropertyValue>(dummy, "Should return PropertyValue instance.");

            var testingTarget = new PropertyValue(dummy);

            Assert.IsNotNull(testingTarget, "Should be not null!");
            Assert.IsInstanceOf <PropertyValue>(testingTarget, "Should return PropertyValue instance.");

            testingTarget.Dispose();
            dummy.Dispose();
            tlog.Debug(tag, $"PropertyValueConstructorWithPropertyValue END (OK)");
        }
예제 #28
0
        public void PropertyMapAddKeyWithInt()
        {
            tlog.Debug(tag, $"PropertyMapAddKeyWithInt START");

            var testingTarget = new PropertyMap();
            Assert.IsNotNull(testingTarget, "should not be null.");
            Assert.IsInstanceOf<PropertyMap>(testingTarget, "should be an instance of PropertyMap class!");

            PropertyValue dummy = new PropertyValue(4.0f);
            Assert.IsNotNull(dummy, "should not be null.");
            Assert.IsInstanceOf<PropertyValue>(dummy, "should be an instance of PropertyValue class!");

            testingTarget.Add(300, dummy);
            Assert.AreEqual(1, testingTarget.Count(), "Retrive testingTarget.Count() should equal to 1.");

            dummy.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"PropertyMapAddKeyWithInt END (OK)");
        }
예제 #29
0
        public void PropertyMapGetKeyAt()
        {
            tlog.Debug(tag, $"PropertyMapGetKeyAt START");

            var testingTarget = new PropertyMap();
            Assert.IsNotNull(testingTarget, "should not be null.");
            Assert.IsInstanceOf<PropertyMap>(testingTarget, "should be an instance of PropertyMap class!");
            
            var dummy = new PropertyValue(4.0f);
            Assert.IsNotNull(dummy, "should not be null.");
            Assert.IsInstanceOf<PropertyValue>(dummy, "should be an instance of PropertyValue class!");

            testingTarget.Add("hello", dummy);
            var key = testingTarget.GetKeyAt(0);
            Assert.AreEqual(PropertyKey.KeyType.String, key.Type, "Retrive key.Type should equal to PropertyKey.KeyType.String");

            dummy.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"PropertyMapGetKeyAt END (OK)");
        }
예제 #30
0
        public void PropertyMapClear()
        {
            tlog.Debug(tag, $"PropertyMapClear START");

            var testingTarget = new PropertyMap();
            Assert.IsNotNull(testingTarget, "should not be null.");
            Assert.IsInstanceOf<PropertyMap>(testingTarget, "should be an instance of PropertyMap class!");

            var dummy = new PropertyValue(5);
            Assert.IsNotNull(dummy, "should not be null.");
            Assert.IsInstanceOf<PropertyValue>(dummy, "should be an instance of PropertyValue class!");

            testingTarget.Add(100, dummy);
            testingTarget.Clear();
            Assert.AreEqual(0, testingTarget.Count(), "Retrive testingTarget.Count() should equal to 0.");

            dummy.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"PropertyMapClear END (OK)");
        }