Mercurial > silverbladetech
annotate Library/LibrarySystem/Core/Publication.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; |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
2 using LibrarySystem.Interfaces; |
41 | 3 |
4 namespace LibrarySystem.Core | |
5 { | |
6 public class Publication : IPublication | |
7 { | |
43
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
8 public string Author { get; private set; } |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
9 public string ISBN { get; private set; } |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
10 public IPublisher Publisher { get; private set; } |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
11 public string Title { get; private set; } |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
12 |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
13 private Publication() |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
14 { |
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 public static IPublication Create(string author, string isbn, IPublisher publisher, string title) |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
19 { |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
20 if (author == null || isbn == null || publisher == null || title == null) |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
21 throw new ArgumentNullException(); |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
22 |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
23 return new Publication() |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
24 { |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
25 Author = author, |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
26 ISBN = isbn, |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
27 Publisher = publisher, |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
28 Title = title |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
29 }; |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
30 } |
41 | 31 } |
32 | |
33 } |