public void ListSourceConstructor() { tlog.Debug(tag, $"ListSourceConstructor START"); var testingTarget = new ListSource(); Assert.IsNotNull(testingTarget, "should be not null"); Assert.IsInstanceOf <ListSource>(testingTarget, "should be an instance of testing target class!"); testingTarget.Dispose(); tlog.Debug(tag, $"ListSourceConstructor END (OK)"); }
public void ListSourceConstructorWithEnumerableObject() { tlog.Debug(tag, $"ListSourceConstructorWithEnumerableObject START"); IEnumerable <string> para = new List <string>(); var testingTarget = new ListSource(para); Assert.IsNotNull(testingTarget, "should be not null"); Assert.IsInstanceOf <ListSource>(testingTarget, "should be an instance of testing target class!"); testingTarget.Dispose(); tlog.Debug(tag, $"ListSourceConstructorWithEnumerableObject END (OK)"); }
public void ListSourceGetItem() { tlog.Debug(tag, $"ListSourceGetItem START"); var para = new TestEnumerable(); var testingTarget = new ListSource(para); Assert.IsNotNull(testingTarget, "should be not null"); Assert.IsInstanceOf <ListSource>(testingTarget, "should be an instance of testing target class!"); Assert.AreEqual(testingTarget.GetItem(0), 1, "The value of the first item of ListSouce should be 1."); testingTarget.Dispose(); tlog.Debug(tag, $"ListSourceGetItem END (OK)"); }
public void ListSourceSyncRoot() { tlog.Debug(tag, $"ListSourceSyncRoot START"); var para = new TestEnumerable(); var testingTarget = new ListSource(para); Assert.IsNotNull(testingTarget, "should be not null"); Assert.IsInstanceOf <ListSource>(testingTarget, "should be an instance of testing target class!"); Assert.IsNotNull(testingTarget.SyncRoot, "SyncRoot of ListSouce should not be null."); testingTarget.Dispose(); tlog.Debug(tag, $"ListSourceSyncRoot END (OK)"); }
public void ListSourceCount() { tlog.Debug(tag, $"ListSourceCount START"); var para = new TestEnumerable(); var testingTarget = new ListSource(para); Assert.IsNotNull(testingTarget, "should be not null"); Assert.IsInstanceOf <ListSource>(testingTarget, "should be an instance of testing target class!"); Assert.AreEqual(testingTarget.Count, 3, "Count of ListSouce should be equal to 3."); testingTarget.Dispose(); tlog.Debug(tag, $"ListSourceCount END (OK)"); }
public void ListSourceIsSynchronized() { tlog.Debug(tag, $"ListSourceIsSynchronized START"); var para = new TestEnumerable(); var testingTarget = new ListSource(para); Assert.IsNotNull(testingTarget, "should be not null"); Assert.IsInstanceOf <ListSource>(testingTarget, "should be an instance of testing target class!"); tlog.Debug(tag, "IsSynchronized : " + testingTarget.IsSynchronized); testingTarget.Dispose(); tlog.Debug(tag, $"ListSourceIsSynchronized END (OK)"); }
public void ListSourceClear() { tlog.Debug(tag, $"ListSourceClear START"); var para = new TestEnumerable(); var testingTarget = new ListSource(para); Assert.IsNotNull(testingTarget, "should be not null"); Assert.IsInstanceOf <ListSource>(testingTarget, "should be an instance of testing target class!"); testingTarget.Clear(); Assert.AreEqual(testingTarget.Count, 0, "The ListSouce should be empty after cleared."); testingTarget.Dispose(); tlog.Debug(tag, $"ListSourceClear END (OK)"); }
public void ListSourceIsHeader() { tlog.Debug(tag, $"ListSourceIsHeader START"); var para = new TestEnumerable(); var testingTarget = new ListSource(para); Assert.IsNotNull(testingTarget, "should be not null"); Assert.IsInstanceOf <ListSource>(testingTarget, "should be an instance of testing target class!"); testingTarget.HasHeader = true; Assert.IsTrue(testingTarget.IsHeader(0), "The first item of ListSouce should be header."); testingTarget.Dispose(); tlog.Debug(tag, $"ListSourceIsHeader END (OK)"); }
public void ListSourceIsFooter() { tlog.Debug(tag, $"ListSourceIsFooter START"); var para = new TestEnumerable(); var testingTarget = new ListSource(para); Assert.IsNotNull(testingTarget, "should be not null"); Assert.IsInstanceOf <ListSource>(testingTarget, "should be an instance of testing target class!"); testingTarget.HasFooter = true; tlog.Debug(tag, "IsFooter : " + testingTarget.IsFooter(2)); testingTarget.Dispose(); tlog.Debug(tag, $"ListSourceIsFooter END (OK)"); }
public void ListSourceIndexOf() { tlog.Debug(tag, $"ListSourceIndexOf START"); var para = new TestEnumerable(); var testingTarget = new ListSource(para); Assert.IsNotNull(testingTarget, "should be not null"); Assert.IsInstanceOf <ListSource>(testingTarget, "should be an instance of testing target class!"); var ret = testingTarget.IndexOf(1); Assert.AreEqual(ret, 0, "The index of ListSouce should be 0."); testingTarget.Dispose(); tlog.Debug(tag, $"ListSourceIndexOf END (OK)"); }
public void ListSourceContains() { tlog.Debug(tag, $"ListSourceContains START"); var para = new TestEnumerable(); var testingTarget = new ListSource(para); Assert.IsNotNull(testingTarget, "should be not null"); Assert.IsInstanceOf <ListSource>(testingTarget, "should be an instance of testing target class!"); var ret = testingTarget.Contains(3); Assert.IsTrue(ret, "The ListSouce should contain 3."); testingTarget.Dispose(); tlog.Debug(tag, $"ListSourceContains END (OK)"); }
public void ListSourceAdd() { tlog.Debug(tag, $"ListSourceAdd START"); var para = new TestEnumerable(); var testingTarget = new ListSource(para); Assert.IsNotNull(testingTarget, "should be not null"); Assert.IsInstanceOf <ListSource>(testingTarget, "should be an instance of testing target class!"); var ret = testingTarget.Add(4); Assert.AreEqual(ret, 3, "The index of ListSouce should is 3."); Assert.AreEqual(testingTarget.Count, 4, "The count of ListSouce should be 4."); testingTarget.Dispose(); tlog.Debug(tag, $"ListSourceAdd END (OK)"); }
public void ListSourceCopyTo() { tlog.Debug(tag, $"ListSourceCopyTo START"); var para = new TestEnumerable(); var testingTarget = new ListSource(para); Assert.IsNotNull(testingTarget, "should be not null"); Assert.IsInstanceOf <ListSource>(testingTarget, "should be an instance of testing target class!"); Array intArray = Array.CreateInstance(typeof(int), 10); intArray.SetValue(4, 0); testingTarget.CopyTo(intArray, 2); tlog.Debug(tag, "Count : " + testingTarget.Count); testingTarget.Dispose(); tlog.Debug(tag, $"ListSourceCopyTo END (OK)"); }