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"); }
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"); }
internal TriggerBase(Type targetType) { if (targetType == null) { throw new ArgumentNullException("targetType"); } TargetType = targetType; EnterActions = new SealedList <TriggerAction>(); ExitActions = new SealedList <TriggerAction>(); }
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"); }
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"); }
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"); }
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"); }
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"); }
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"); }
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"); }
internal TriggerBase(Condition condition, Type targetType) : this(targetType) { Setters = new SealedList <Setter>(); Condition = condition; Condition.ConditionChanged = OnConditionChanged; }
public EventTrigger() : base(typeof(BindableObject)) { Actions = new SealedList <TriggerAction>(); }
internal TriggerBase(Condition condition) : this() { Setters = new SealedList <Setter>(); Condition = condition; Condition.ConditionChanged = OnConditionChanged; }
internal TriggerBase() { EnterActions = new SealedList <TriggerAction>(); ExitActions = new SealedList <TriggerAction>(); }