本文整理汇总了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));
}
示例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));
}
示例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));
}
示例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);
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}