comparison Library/LibrarySystem.Tests/Core/PersonTests.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 PersonTests
9 {
10 [Test]
11 public void Create_WithValidParams_ShouldReturnPerson()
12 {
13 var person = Person.Create("dummy", "dummy");
14 Assert.IsNotNull(person);
15 }
16
17 [Test]
18 public void Create_WithNullAddress_ShouldThrowAgrumentNullException()
19 {
20 Assert.Throws<ArgumentNullException>(() => Person.Create(null, "dummy"));
21 }
22
23 [Test]
24 public void Create_WithNullName_ShouldThrowAgrumentNullException()
25 {
26 Assert.Throws<ArgumentNullException>(() => Person.Create("dummy", null));
27 }
28
29 [Test]
30 public void Create_WithNullAddressAndName_ShouldThrowAgrumentNullException()
31 {
32 Assert.Throws<ArgumentNullException>(() => Person.Create(null, null));
33 }
34 }
35 }