annotate Library/LibrarySystem/Core/Stock.cs @ 58:241e2f22ed3c

Latest version
author Steven Hollidge <stevenhollidge@hotmail.com>
date Sat, 21 Apr 2012 15:06:48 +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 Stock : IStock
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 IBook Book { get; private set; }
41
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
9 public bool IsAvailable { get; set; }
43
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
10
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
11 private Stock()
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
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 public static IStock Create(IBook book, bool isAvailable)
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 if (book == null)
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
19 throw new ArgumentNullException();
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
20
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
21 return new Stock() {Book = book, IsAvailable = isAvailable};
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 41
diff changeset
22 }
41
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
23 }
dbd242eb9c33 Initial wave of TDD development
adminsh@apollo
parents:
diff changeset
24 }