Mercurial > silverbladetech
annotate Library/LibrarySystem/Core/Book.cs @ 43:aef06698d9e2 Test
Added the library tests
author | Steven Hollidge <stevenhollidge@hotmail.com> |
---|---|
date | Wed, 04 Apr 2012 19:20:20 +0100 |
parents | dbd242eb9c33 |
children |
rev | line source |
---|---|
43
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
1 using System; |
41 | 2 using LibrarySystem.Interfaces; |
3 | |
4 namespace LibrarySystem.Core | |
5 { | |
6 public class Book : IBook | |
7 { | |
8 public string Author { get; set; } | |
9 public string ISBN { get; set; } | |
10 public IPublisher Publisher { get; set; } | |
11 public string Title { get; set; } | |
12 public string Id { get; set; } | |
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 | 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 | 32 } |
33 } | |
34 } |