annotate Library/LibrarySystem/Core/Person.cs @ 110:0185b15e04ba

Test added for multi property validation
author stevenhollidge <stevenhollidge@hotmail.com>
date Sun, 06 May 2012 20:43:37 +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.Interfaces;
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
3
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
4 namespace LibrarySystem.Core
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
5 {
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
6 public class Person : IPerson
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
7 {
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
8 public string Address { get; private set; }
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
9 public string Name { get; private set; }
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
10
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
11 private Person()
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
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
14 }
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
15
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
16 public static IPerson Create(string address, string name)
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 if (address == null || name == null)
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
19 throw new ArgumentNullException();
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 return new Person() { Address = address, Name = name};
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 }
aef06698d9e2 Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
24 }