当前位置: 首页>>代码示例>>C#>>正文


C# DynamicList类代码示例

本文整理汇总了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);
        }
开发者ID:ZahariyaPehlivanova,项目名称:KPK-Unit-Testing-Homework,代码行数:7,代码来源:CustomLinkedListTests.cs

示例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!");
        }
开发者ID:ZahariyaPehlivanova,项目名称:KPK-Unit-Testing-Homework,代码行数:7,代码来源:CustomLinkedListTests.cs

示例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.");
 }
开发者ID:clueless92,项目名称:HQCHomeworks,代码行数:7,代码来源:UnitTests.cs

示例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.");
 }
开发者ID:EBojilova,项目名称:CSharpHQC,代码行数:7,代码来源:DynamicListTests.cs

示例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]);
 }
开发者ID:pavelilchev,项目名称:HomeWorks,代码行数:7,代码来源:TestDynamicListIndexer.cs

示例6: TestAddNodeWithValueOfOneMustCreatCorrectNode

        public void TestAddNodeWithValueOfOneMustCreatCorrectNode()
        {
            var list = new DynamicList<int>();
            list.Add(1);

            Assert.AreEqual(1, list[0]);
        }
开发者ID:Jazastry,项目名称:SoftUni,代码行数:7,代码来源:DynamicListTests.cs

示例7: TestAddingNewNodeOnTailPositionEmptyList

        public void TestAddingNewNodeOnTailPositionEmptyList()
        {
            var list = new DynamicList<int>();
            list.Add(1);

            Assert.AreEqual(1, list[0]);
        }
开发者ID:Jazastry,项目名称:SoftUni,代码行数:7,代码来源:DynamicListTests.cs

示例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!");
        }
开发者ID:i-yotov,项目名称:Courses,代码行数:7,代码来源:DynamicListTests.cs

示例9: AddTests

 public void AddTests()
 {
     var list = new DynamicList<int>();
     list.Add(1);
     Assert.AreEqual(1, list.Count);
     Assert.AreEqual(1, list.ItemAtIndex(0));
 }
开发者ID:rmacdonaldsmith,项目名称:DataStructures,代码行数:7,代码来源:DynamicLists.Tests.cs

示例10: TestList_SetIndex_ShouldThrowException

        public void TestList_SetIndex_ShouldThrowException()
        {
            DynamicList<int> list = new DynamicList<int>();
            int setterIndexTest = 9;

            list[3] = setterIndexTest;
        }
开发者ID:emilrr,项目名称:SoftUni-Fundamental-Level,代码行数:7,代码来源:CustomLinkedListTests.cs

示例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));
        }
开发者ID:EBojilova,项目名称:SoftUni-3,代码行数:7,代码来源:DynamicListTests.cs

示例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);
 }
开发者ID:pavelilchev,项目名称:HomeWorks,代码行数:7,代码来源:TestDynamicListAddRemoveCount.cs

示例13: TestRemove_NotExistingElement_ShouldNeutralIndex

        public void TestRemove_NotExistingElement_ShouldNeutralIndex()
        {
            var list = new DynamicList<int>();

            var index = list.Remove(1);
            Assert.AreEqual(-1, index);
        }
开发者ID:pavelilchev,项目名称:HomeWorks,代码行数:7,代码来源:TestDynamicListAddRemoveCount.cs

示例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.");
 }
开发者ID:ivailojordanov,项目名称:Fundamental-Level,代码行数:7,代码来源:UnitTest1.cs

示例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);
 }
开发者ID:pavelilchev,项目名称:HomeWorks,代码行数:7,代码来源:TestDynamicListIndexer.cs


注:本文中的DynamicList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。