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


C# Book.AddRange方法代码示例

本文整理汇总了C#中Book.AddRange方法的典型用法代码示例。如果您正苦于以下问题:C# Book.AddRange方法的具体用法?C# Book.AddRange怎么用?C# Book.AddRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Book的用法示例。


在下文中一共展示了Book.AddRange方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HowManyPagesLeft_When_overlapped_ranges_are_a0dded_Then_returns_correct_count_of_unread_pages

        public void HowManyPagesLeft_When_overlapped_ranges_are_a0dded_Then_returns_correct_count_of_unread_pages()
        {
            var book = new Book(10);
            book.AddRange(3, 4);
            book.AddRange(3, 10);

            var leftPages = book.HowManyPagesLeft();

            Assert.That(leftPages, Is.EqualTo(2));
        }
开发者ID:IhorSyerkov,项目名称:NET_CodeTesting,代码行数:10,代码来源:BookTests.cs

示例2: HowManyPagesLeft_When_overlapped_ranges_added_Then_returns_correct_count_of_unread_pages

        public void HowManyPagesLeft_When_overlapped_ranges_added_Then_returns_correct_count_of_unread_pages(int from1,
            int to1, int from2, int to2, int pageCount, int expected)
        {
            var book = new Book(pageCount);
            book.AddRange(from1, to1);
            book.AddRange(from2, to2);

            var leftPages = book.HowManyPagesLeft();

            Assert.That(leftPages, Is.EqualTo(expected));
        }
开发者ID:DarknessSwitch,项目名称:Code_Testing_Homework,代码行数:11,代码来源:BookTests.cs

示例3: HowManyPagesLeft_When_given_few_read_ranges_Then_returns_correct_count_of_unread_pages

        public void HowManyPagesLeft_When_given_few_read_ranges_Then_returns_correct_count_of_unread_pages()
        {
            // Arrange
            var book = new Book(10);
            book.AddRange(3, 4);
            book.AddRange(6, 8);

            // Act
            var leftPages = book.HowManyPagesLeft();

            // Assert
            Assert.That(leftPages, Is.EqualTo(5));
        }
开发者ID:yrikturash,项目名称:binarystudio-tests,代码行数:13,代码来源:BookTests.cs

示例4: HowMushPagesLeft_When_overlap_few_page_Then_should_be_right_page_say

        public void HowMushPagesLeft_When_overlap_few_page_Then_should_be_right_page_say()
        {
            // Arrange
            var book = new Book(10);
            book.AddRange(3, 7);
            book.AddRange(7, 9);

            // Act
            var leftPages = book.HowManyPagesLeft();

            // Assert
            Assert.AreEqual(1,leftPages);
        }
开发者ID:Budzyn,项目名称:test,代码行数:13,代码来源:TODO2Test.cs

示例5: HowManyPagesLeft_When_give_overlapped_ranges_Then_correct_count_of_unread_pages

        public void HowManyPagesLeft_When_give_overlapped_ranges_Then_correct_count_of_unread_pages()
        {
            // Arrange
            var book = new Book(10);
            book.AddRange(3, 5);
            book.AddRange(4, 8);

            // Act
            var leftPages = book.HowManyPagesLeft();

            // Assert
            Assert.That(leftPages, Is.EqualTo(4));
        }
开发者ID:kuwkuw,项目名称:NET_CodeTesting,代码行数:13,代码来源:BookTests.cs

示例6: Crl_HowManyPagesLeft_Should_correctly_counts_pages_When_overlapped_ranges

        public void Crl_HowManyPagesLeft_Should_correctly_counts_pages_When_overlapped_ranges()
        {
            // Arrange
            var book = new Book(50);
            book.AddRange(1, 40);
            book.AddRange(6, 8);

            // Act
            var leftPages = book.HowManyPagesLeft();

            // Assert
            Assert.That(leftPages, Is.EqualTo(10));
        }
开发者ID:alexkaduk,项目名称:bsa15-lec5-CodeTesting,代码行数:13,代码来源:BookTests.cs

示例7: HowManyPagesLeft_When_given_overlapped_ranges_Then_returns_correct_count_of_unread_pages

        public void HowManyPagesLeft_When_given_overlapped_ranges_Then_returns_correct_count_of_unread_pages()
        {
            // Arrange
            Book book = new Book(8);

            book.AddRange(4,6);
            book.AddRange(5,10);

            // Act
            int leftPages = book.HowManyPagesLeft();

            //Assert
            Assert.That(leftPages,Is.EqualTo(3));
        }
开发者ID:GerasimIG,项目名称:NET_CodeTesting,代码行数:14,代码来源:BookTests.cs

示例8: HowManyPagesLeft_When_given_few_read_overlapped_ranges_Then_return_correct_count_of_unread_pages

        public void HowManyPagesLeft_When_given_few_read_overlapped_ranges_Then_return_correct_count_of_unread_pages()
        {
            //arrange
            var book = new Book(10);
            book.AddRange(1, 5);
            book.AddRange(2, 4);
            book.AddRange(9, 10);

            //act
            var leftPages = book.HowManyPagesLeft();

            //assert
            Assert.That(leftPages, Is.EqualTo(3));
        }
开发者ID:AndrewEmets,项目名称:BSA_UnitTest,代码行数:14,代码来源:BookTests.cs

示例9: Book

        public void HowManyPagesLeftOverlapped_When_overlapped_ranges_are_added_Then_returns_correct_count_of_unread_pages()
        {
            // Arrange
            var book = new Book(20);
            book.AddRange(4, 7);
            book.AddRange(5, 10);
            book.AddRange(6, 11);
            book.AddRange(5, 7);

            // Act
            var leftPages = book.HowManyPagesLeft();

            // Assert
            Assert.That(leftPages, Is.EqualTo(12));
        }
开发者ID:yrikturash,项目名称:binarystudio-tests,代码行数:15,代码来源:BookTests.cs


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