Beispiel #1
0
        public void Clear()
        {
            // No items.
            {
                var o = new ValueMap();

                Assert.AreEqual(0, o.Values.Count);
                Assert.AreEqual(0, o.ChildMaps.Count);

                o.Clear();

                Assert.AreEqual(0, o.Values.Count);
                Assert.AreEqual(0, o.ChildMaps.Count);
            }

            // Only values.
            {
                var o = new ValueMap();
                o.AddParam(RequestParam.AccountID, true);
                o.AddParam(RequestParam.AccountName, "Test");

                Assert.AreEqual(2, o.Values.Count);
                Assert.AreEqual(0, o.ChildMaps.Count);

                o.Clear();

                Assert.AreEqual(0, o.Values.Count);
                Assert.AreEqual(0, o.ChildMaps.Count);
            }

            // Values and child maps.
            {
                var o = new ValueMap();

                o.AddParam(RequestParam.AccountID, true);
                o.AddParam(RequestParam.AccountName, "Test");
                o.AddChild(new ValueMap());

                Assert.AreEqual(2, o.Values.Count);
                Assert.AreEqual(1, o.ChildMaps.Count);

                o.Clear();

                Assert.AreEqual(0, o.Values.Count);
                Assert.AreEqual(0, o.ChildMaps.Count);
            }

            // Only child maps.
            {
                var o = new ValueMap();

                o.AddChild(new ValueMap());

                Assert.AreEqual(0, o.Values.Count);
                Assert.AreEqual(1, o.ChildMaps.Count);

                o.Clear();

                Assert.AreEqual(0, o.Values.Count);
                Assert.AreEqual(0, o.ChildMaps.Count);
            }
        }
Beispiel #2
0
 public void CleanUpData()
 {
     VisualisationUpToDate = false;
     Values.Clear();
 }