You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
2.4 KiB
47 lines
2.4 KiB
using System;
|
|
using System.Collections;
|
|
using Model;
|
|
using Stub;
|
|
|
|
namespace TestDataManager;
|
|
|
|
|
|
|
|
public class TestData_BorrowBook : IEnumerable<object[]>
|
|
{
|
|
public IEnumerator<object[]> GetEnumerator()
|
|
{
|
|
//no book and no borrower
|
|
yield return new object[] { false, null, null, new BorrowBookStub() };
|
|
|
|
//no book
|
|
yield return new object[] { false, null, new Person("John", "Coltrane"), new StubDataManager() };
|
|
|
|
//no borrower
|
|
yield return new object[] { false, new Book( "Les Pardaillan", "Michel Zévaco", "978-2221098417"), null, new BorrowBookStub() };
|
|
|
|
//new book and new borrower
|
|
yield return new object[] { false, new Book( "Les Pardaillan", "Michel Zévaco", "978-2221098417"), new Person("John", "Coltrane"), new BorrowBookStub() };
|
|
|
|
//new book and already known borrower
|
|
yield return new object[] { false, new Book( "Les Pardaillan", "Michel Zévaco", "978-2221098417"), new Person(1, "Chick", "Corea"), new BorrowBookStub() };
|
|
|
|
//already known but free book and new borrower
|
|
yield return new object[] { false, new Book(2, "Les Misérables", "Victor Hugo", "979-8850172916"), new Person("John", "Coltrane"), new BorrowBookStub() };
|
|
|
|
//already known but already borrowed book and new borrower
|
|
yield return new object[] { false, new Book(1, "Les Trois Mousquetaires", "Alexandre Dumas", "979-8415441792"), new Person("John", "Coltrane"), new BorrowBookStub() };
|
|
|
|
//already known but free book and already known borrower
|
|
yield return new object[] { true, new Book(2, "Les Misérables", "Victor Hugo", "979-8850172916"), new Person(1, "Chick", "Corea"), new BorrowBookStub() };
|
|
|
|
//already known but already borrowed book by another borrower and already known borrower
|
|
yield return new object[] { false, new Book(1, "Les Trois Mousquetaires", "Alexandre Dumas", "979-8415441792"), new Person(2, "Stanley", "Clarke"), new BorrowBookStub() };
|
|
|
|
//already known but already borrowed book by this borrower and already known borrower
|
|
yield return new object[] { true, new Book(1, "Les Trois Mousquetaires", "Alexandre Dumas", "979-8415441792"), new Person(1, "Chick", "Corea"), new BorrowBookStub() };
|
|
}
|
|
|
|
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
|
}
|