comparison Library/LibrarySystem.Tests/Core/PublicationTests.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
comparison
equal deleted inserted replaced
42:0d4aff4f699d 43:aef06698d9e2
1 using System;
2 using LibrarySystem.Core;
3 using NUnit.Framework;
4
5 namespace LibrarySystem.Tests.Core
6 {
7 [TestFixture]
8 class PublicationTests
9 {
10 [Test]
11 public void Create_WithValidParams_ShouldReturnPublication()
12 {
13 var publisher = Publisher.Create("dummy");
14 var publication = Publication.Create("dummy","dummy", publisher, "dummy");
15 Assert.IsNotNull(publication);
16 }
17
18 [Test]
19 public void Create_WithNullAuthor_ShouldThrowAgrumentNullException()
20 {
21 var publisher = Publisher.Create("dummy");
22 Assert.Throws<ArgumentNullException>(() => Publication.Create(null, "dummy", publisher, "dummy"));
23 }
24
25 [Test]
26 public void Create_WithNullISBN_ShouldThrowAgrumentNullException()
27 {
28 var publisher = Publisher.Create("dummy");
29 Assert.Throws<ArgumentNullException>(() => Publication.Create("dummy", null, publisher, "dummy"));
30 }
31
32 [Test]
33 public void Create_WithNullPublisher_ShouldThrowAgrumentNullException()
34 {
35 Assert.Throws<ArgumentNullException>(() => Publication.Create("dummy","dummy", null, "dummy"));
36 }
37
38 [Test]
39 public void Create_WithNullTitle_ShouldThrowAgrumentNullException()
40 {
41 var publisher = Publisher.Create("dummy");
42 Assert.Throws<ArgumentNullException>(() => Publication.Create("dummy", "dummy", publisher, null));
43 }
44 }
45 }