comparison Library/LibrarySystem/Core/Stock.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
comparison
equal deleted inserted replaced
42:0d4aff4f699d 43:aef06698d9e2
1 using LibrarySystem.Interfaces; 1 using System;
2 using LibrarySystem.Interfaces;
2 3
3 namespace LibrarySystem.Core 4 namespace LibrarySystem.Core
4 { 5 {
5 public class Stock : IStock 6 public class Stock : IStock
6 { 7 {
8 public IBook Book { get; private set; }
7 public bool IsAvailable { get; set; } 9 public bool IsAvailable { get; set; }
8 public IBook Book { get; set; } 10
11 private Stock()
12 {
13
14 }
15
16 public static IStock Create(IBook book, bool isAvailable)
17 {
18 if (book == null)
19 throw new ArgumentNullException();
20
21 return new Stock() {Book = book, IsAvailable = isAvailable};
22 }
9 } 23 }
10 } 24 }