annotate Library/LibrarySystem/Core/Book.cs @ 121:8f94475d3146 tip

final code
author stevenh7776
date Thu, 31 May 2012 15:35:26 +0100
parents aef06698d9e2
children
rev   line source
43
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
1 using System;
41
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
2 using LibrarySystem.Interfaces;
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
3
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
4 namespace LibrarySystem.Core
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
5 {
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
6 public class Book : IBook
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
7 {
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
8 public string Author { get; set; }
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
9 public string ISBN { get; set; }
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
10 public IPublisher Publisher { get; set; }
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
11 public string Title { get; set; }
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
12 public string Id { get; set; }
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
13
43
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
14 private Book()
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
15 {
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
16
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
17 }
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
18
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
19 public static IBook Create(string id, IPublication publication)
41
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
20 {
43
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
21 if (id == null || publication == null)
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
22 throw new ArgumentNullException();
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
23
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
24 return new Book()
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
25 {
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
26 Author = publication.Author,
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
27 Id = id,
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
28 ISBN = publication.ISBN,
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
29 Title = publication.Title,
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
30 Publisher = publication.Publisher
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
31 };
41
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
32 }
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
33 }
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
34 }