本文整理汇总了C#中DynamicList类的典型用法代码示例。如果您正苦于以下问题:C# DynamicList类的具体用法?C# DynamicList怎么用?C# DynamicList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DynamicList类属于命名空间,在下文中一共展示了DynamicList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestRemoveAtMethod_WithNegativeIndex_ShouldThrow
public void TestRemoveAtMethod_WithNegativeIndex_ShouldThrow()
{
DynamicList<int> arr = new DynamicList<int>();
arr.Add(1);
arr.RemoveAt(-1);
}
示例2: TestObject_OnExistingIndex_ShouldReturnCorrectObject
public void TestObject_OnExistingIndex_ShouldReturnCorrectObject()
{
DynamicList<int> arr = new DynamicList<int>();
arr.Add(1);
Assert.AreEqual(1, arr[0],"The index is not correct!");
}
示例3: TestCount_ValidCountOnNewListCreation_ExpectSuccess
public void TestCount_ValidCountOnNewListCreation_ExpectSuccess()
{
DynamicList<int> list = new DynamicList<int>();
int actual = list.Count;
int expected = 0;
Assert.AreEqual(expected, actual, "List count should be 0.");
}
示例4: Test_ValueOfTheOneElementAdded
public void Test_ValueOfTheOneElementAdded()
{
var list = new DynamicList<int>();
list.Add(15);
var value = list[0];
Assert.AreEqual(15, value, "The value at index 0 should be equal to the value entered.");
}
示例5: Index_SetValidIndex_ShouldChangeElement
public void Index_SetValidIndex_ShouldChangeElement()
{
var list = new DynamicList<int>();
list.Add(1);
list[0] = 3;
Assert.AreEqual(3, list[0]);
}
示例6: TestAddNodeWithValueOfOneMustCreatCorrectNode
public void TestAddNodeWithValueOfOneMustCreatCorrectNode()
{
var list = new DynamicList<int>();
list.Add(1);
Assert.AreEqual(1, list[0]);
}
示例7: TestAddingNewNodeOnTailPositionEmptyList
public void TestAddingNewNodeOnTailPositionEmptyList()
{
var list = new DynamicList<int>();
list.Add(1);
Assert.AreEqual(1, list[0]);
}
示例8: CreateNewDynamicList_EmptyCollection
public void CreateNewDynamicList_EmptyCollection()
{
var dynamicList = new DynamicList<int>();
var lenght = dynamicList.Count;
Assert.AreEqual(0, lenght, "Collection lenght should be 0!");
}
示例9: AddTests
public void AddTests()
{
var list = new DynamicList<int>();
list.Add(1);
Assert.AreEqual(1, list.Count);
Assert.AreEqual(1, list.ItemAtIndex(0));
}
示例10: TestList_SetIndex_ShouldThrowException
public void TestList_SetIndex_ShouldThrowException()
{
DynamicList<int> list = new DynamicList<int>();
int setterIndexTest = 9;
list[3] = setterIndexTest;
}
示例11: DynamicListTest
public void DynamicListTest()
{
var testValue = new DynamicList<string>();
int expected = 0;
Assert.AreEqual(expected, testValue.Count, string.Format("The expected count of {0} did not match the actual value of {1}", expected,testValue.Count));
}
示例12: Count_AddToList_ShouldBeProperCount
public void Count_AddToList_ShouldBeProperCount()
{
var list = new DynamicList<int>();
list.Add(1);
var count = list.Count;
Assert.AreEqual(1, count);
}
示例13: TestRemove_NotExistingElement_ShouldNeutralIndex
public void TestRemove_NotExistingElement_ShouldNeutralIndex()
{
var list = new DynamicList<int>();
var index = list.Remove(1);
Assert.AreEqual(-1, index);
}
示例14: TestAddOneElementToList
public void TestAddOneElementToList()
{
DynamicList<int> list = new DynamicList<int>();
list.Add(15);
int value = list[0];
Assert.AreEqual(15, value, "The value at index 0 should be equal to the value entered.");
}
示例15: Index_GetValidIndex_ShouldReturnProperElement
public void Index_GetValidIndex_ShouldReturnProperElement()
{
var list = new DynamicList<int>();
list.Add(1);
var element = list[0];
Assert.AreEqual(1, element);
}