annotate Library/LibrarySystem.Tests/Core/PublicationTests.cs @ 60:fc62c971a117

upload to blog
author Steven Hollidge <stevenhollidge@hotmail.com>
date Sat, 21 Apr 2012 21:19:39 +0100
parents aef06698d9e2
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 PublicationTests
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_WithValidParams_ShouldReturnPublication()
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 Assert.IsNotNull(publication);
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
16 }
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
17
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
18 [Test]
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
19 public void Create_WithNullAuthor_ShouldThrowAgrumentNullException()
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
20 {
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
21 var publisher = Publisher.Create("dummy");
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
22 Assert.Throws<ArgumentNullException>(() => Publication.Create(null, "dummy", publisher, "dummy"));
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
23 }
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 [Test]
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
26 public void Create_WithNullISBN_ShouldThrowAgrumentNullException()
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
27 {
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
28 var publisher = Publisher.Create("dummy");
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
29 Assert.Throws<ArgumentNullException>(() => Publication.Create("dummy", null, publisher, "dummy"));
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
30 }
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
31
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
32 [Test]
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
33 public void Create_WithNullPublisher_ShouldThrowAgrumentNullException()
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
34 {
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
35 Assert.Throws<ArgumentNullException>(() => Publication.Create("dummy","dummy", null, "dummy"));
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
36 }
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
37
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
38 [Test]
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
39 public void Create_WithNullTitle_ShouldThrowAgrumentNullException()
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
40 {
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
41 var publisher = Publisher.Create("dummy");
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
42 Assert.Throws<ArgumentNullException>(() => Publication.Create("dummy", "dummy", publisher, null));
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
43 }
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
44 }
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
45 }