annotate Library/LibrarySystem/Core/Publication.cs @ 108:b728c44d9c61

StatLight added to repo
author stevenhollidge <stevenhollidge@hotmail.com>
date Sun, 06 May 2012 16:15:42 +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;
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
2 using LibrarySystem.Interfaces;
41
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 Publication : IPublication
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
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
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
31 }
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
32
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
33 }