Mercurial > silverbladetech
annotate Library/LibrarySystem.Tests/Core/StockTests.cs @ 43:aef06698d9e2 Test
Added the library tests
author | Steven Hollidge <stevenhollidge@hotmail.com> |
---|---|
date | Wed, 04 Apr 2012 19:20:20 +0100 |
parents | |
children |
rev | line source |
---|---|
43
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
1 using System; |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
2 using LibrarySystem.Core; |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
3 using NUnit.Framework; |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
4 |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
5 namespace LibrarySystem.Tests.Core |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
6 { |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
7 [TestFixture] |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
8 class StockTests |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
9 { |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
10 [Test] |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
11 public void Create_WithValidName_ShouldReturnPublisher() |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
12 { |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
13 var publisher = Publisher.Create("dummy"); |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
14 var publication = Publication.Create("dummy","dummy", publisher, "dummy"); |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
15 var book = Book.Create("dummy", publication); |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
16 var stock = Stock.Create(book, true); |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
17 Assert.IsNotNull(stock); |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
18 } |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
19 |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
20 [Test] |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
21 public void Create_WithNullBook_ShouldThrowAgrumentNullException() |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
22 { |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
23 Assert.Throws<ArgumentNullException>(() => Stock.Create(null, true)); |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
24 } |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
25 } |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
26 } |