Пример #1
0
        public void SealedListContainsTest()
        {
            tlog.Debug(tag, $"SealedListContainsTest START");
            try
            {
                var sl = new SealedList <int>();
                Assert.IsNotNull(sl, "null SealedList");
                sl.Add(1);
                var ret = sl.Contains(1);
                Assert.AreEqual(true, ret, "Should be equal");

                int[] ia = new int[] { 1, 2, 3 };
                sl.CopyTo(ia, 0);

                var ret2 = sl.GetEnumerator();
                var ret3 = sl.IndexOf(1);
                sl.Insert(0, 2);
                var ret4 = sl[1];
                sl.Remove(1);

                sl.Insert(0, 3);
                sl.RemoveAt(0);
            }
            catch (Exception e)
            {
                Assert.Fail("Caught Exception" + e.ToString());
            }
            tlog.Debug(tag, $"SealedListContainsTest END");
        }
Пример #2
0
        public void SealedListClearTest2()
        {
            tlog.Debug(tag, $"SealedListClearTest2 START");
            var sl = new SealedList <int>();

            Assert.IsNotNull(sl, "null SealedList");
            sl.IsReadOnly = true;
            Assert.Throws <InvalidOperationException>(() => sl.Clear());
            tlog.Debug(tag, $"SealedListClearTest2 END");
        }
Пример #3
0
        internal TriggerBase(Type targetType)
        {
            if (targetType == null)
            {
                throw new ArgumentNullException("targetType");
            }
            TargetType = targetType;

            EnterActions = new SealedList <TriggerAction>();
            ExitActions  = new SealedList <TriggerAction>();
        }
Пример #4
0
        public void SealedListSyncRootTest()
        {
            tlog.Debug(tag, $"SealedListSyncRootTest START");
            var sl = new SealedList <int>();

            Assert.IsNotNull(sl, "null SealedList");
            object bl;

            Assert.Throws <NotImplementedException>(() => bl = sl.SyncRoot);
            tlog.Debug(tag, $"SealedListSyncRootTest END");
        }
Пример #5
0
        public void SealedListIsSynchronizedTest()
        {
            tlog.Debug(tag, $"SealedListIsSynchronizedTest START");
            var sl = new SealedList <int>();

            Assert.IsNotNull(sl, "null SealedList");
            bool bl;

            Assert.Throws <NotImplementedException>(() => bl = sl.IsSynchronized);
            tlog.Debug(tag, $"SealedListIsSynchronizedTest END");
        }
Пример #6
0
        public void IsReadOnly()
        {
            tlog.Debug(tag, $"IsReadOnly START");

            var sl = new SealedList <int>();

            Assert.IsNotNull(sl, "null SealedList");
            sl.IsReadOnly = true;
            sl.IsReadOnly = true; //Reassign
            Assert.Throws <InvalidOperationException>(() => sl.IsReadOnly = false);
            tlog.Debug(tag, $"IsReadOnly END");
        }
Пример #7
0
        public void SealedListRemoveAtTest()
        {
            tlog.Debug(tag, $"SealedListRemoveAtTest START");

            var sl = new SealedList <int>();

            Assert.IsNotNull(sl, "null SealedList");
            sl.Add(1);
            sl.IsReadOnly = true;
            Assert.Throws <InvalidOperationException>(() => sl.RemoveAt(0));

            tlog.Debug(tag, $"SealedListRemoveAtTest END");
        }
Пример #8
0
 public void SealedListAddTest()
 {
     tlog.Debug(tag, $"SealedListAddTest START");
     try
     {
         var sl = new SealedList <int>();
         Assert.IsNotNull(sl, "null SealedList");
         sl.Add(1);
     }
     catch (Exception e)
     {
         Assert.Fail("Caught Exception" + e.ToString());
     }
     tlog.Debug(tag, $"SealedListAddTest END");
 }
Пример #9
0
        public void TriggerConstructor()
        {
            tlog.Debug(tag, $"TriggerConstructor START");

            try
            {
                var sl = new SealedList <int>();

                Assert.IsNotNull(sl, "null SealedList");
                Assert.IsInstanceOf <SealedList <int> >(sl, "Should return SealedList instance.");
            }
            catch (Exception e)
            {
                Assert.Fail("Caught Exception" + e.ToString());
            }

            tlog.Debug(tag, $"TriggerConstructor END");
        }
Пример #10
0
        public void Contains()
        {
            tlog.Debug(tag, $"Contains START");

            var sl = new SealedList <int>();

            Assert.IsNotNull(sl, "null SealedList");
            sl.Add(1);
            var ret = sl.Contains(1);

            Assert.AreEqual(true, ret, "Should be equal");
            var ret2 = sl.IndexOf(1);

            Assert.AreEqual(0, ret2, "Should be equal");
            sl.Remove(1);
            sl.CopyTo(new int[1] {
                3
            }, 0);
            tlog.Debug(tag, $"IsReadOnly END");
        }
Пример #11
0
 internal TriggerBase(Condition condition, Type targetType) : this(targetType)
 {
     Setters   = new SealedList <Setter>();
     Condition = condition;
     Condition.ConditionChanged = OnConditionChanged;
 }
Пример #12
0
 public EventTrigger() : base(typeof(BindableObject))
 {
     Actions = new SealedList <TriggerAction>();
 }
Пример #13
0
 internal TriggerBase(Condition condition) : this()
 {
     Setters   = new SealedList <Setter>();
     Condition = condition;
     Condition.ConditionChanged = OnConditionChanged;
 }
Пример #14
0
 internal TriggerBase()
 {
     EnterActions = new SealedList <TriggerAction>();
     ExitActions  = new SealedList <TriggerAction>();
 }