Mercurial > silverbladetech
annotate SilverlightValidation/SilverlightValidation.Tests/ViewModels/UserViewModel_Constructor.cs @ 114:e51a6af1c98d
working version
author | adminsh@apollo |
---|---|
date | Sat, 19 May 2012 16:53:34 +0100 |
parents | 11994ccdc50b |
children |
rev | line source |
---|---|
97
1adc1ae981ea
Tests added to SilverlightValidation.Tests
stevenhollidge <stevenhollidge@hotmail.com>
parents:
96
diff
changeset
|
1 using System; |
107
572886951353
Working tests under StatLight
stevenhollidge <stevenhollidge@hotmail.com>
parents:
106
diff
changeset
|
2 using Microsoft.VisualStudio.TestTools.UnitTesting; |
97
1adc1ae981ea
Tests added to SilverlightValidation.Tests
stevenhollidge <stevenhollidge@hotmail.com>
parents:
96
diff
changeset
|
3 using SilverlightValidation.Models; |
1adc1ae981ea
Tests added to SilverlightValidation.Tests
stevenhollidge <stevenhollidge@hotmail.com>
parents:
96
diff
changeset
|
4 using SilverlightValidation.Validators; |
1adc1ae981ea
Tests added to SilverlightValidation.Tests
stevenhollidge <stevenhollidge@hotmail.com>
parents:
96
diff
changeset
|
5 using SilverlightValidation.ViewModels; |
96
188f8b366e87
Unit test project correctly setup as normal class library DLL.
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
6 |
188f8b366e87
Unit test project correctly setup as normal class library DLL.
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
7 namespace SilverlightValidation.Tests.ViewModels |
188f8b366e87
Unit test project correctly setup as normal class library DLL.
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
8 { |
107
572886951353
Working tests under StatLight
stevenhollidge <stevenhollidge@hotmail.com>
parents:
106
diff
changeset
|
9 [TestClass] |
109
11994ccdc50b
First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
107
diff
changeset
|
10 public class UserViewModel_Constructor |
96
188f8b366e87
Unit test project correctly setup as normal class library DLL.
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
11 { |
107
572886951353
Working tests under StatLight
stevenhollidge <stevenhollidge@hotmail.com>
parents:
106
diff
changeset
|
12 [TestMethod] |
572886951353
Working tests under StatLight
stevenhollidge <stevenhollidge@hotmail.com>
parents:
106
diff
changeset
|
13 [ExpectedException(typeof(ArgumentNullException))] |
572886951353
Working tests under StatLight
stevenhollidge <stevenhollidge@hotmail.com>
parents:
106
diff
changeset
|
14 public void WhenConstructed_WithTwoNulls_ThenThrowsArgumentNullException() |
97
1adc1ae981ea
Tests added to SilverlightValidation.Tests
stevenhollidge <stevenhollidge@hotmail.com>
parents:
96
diff
changeset
|
15 { |
107
572886951353
Working tests under StatLight
stevenhollidge <stevenhollidge@hotmail.com>
parents:
106
diff
changeset
|
16 new UserViewModel(null, null); |
97
1adc1ae981ea
Tests added to SilverlightValidation.Tests
stevenhollidge <stevenhollidge@hotmail.com>
parents:
96
diff
changeset
|
17 } |
1adc1ae981ea
Tests added to SilverlightValidation.Tests
stevenhollidge <stevenhollidge@hotmail.com>
parents:
96
diff
changeset
|
18 |
107
572886951353
Working tests under StatLight
stevenhollidge <stevenhollidge@hotmail.com>
parents:
106
diff
changeset
|
19 [TestMethod] |
572886951353
Working tests under StatLight
stevenhollidge <stevenhollidge@hotmail.com>
parents:
106
diff
changeset
|
20 [ExpectedException(typeof(ArgumentNullException))] |
572886951353
Working tests under StatLight
stevenhollidge <stevenhollidge@hotmail.com>
parents:
106
diff
changeset
|
21 public void WhenConstructed_WithNullFirstParam_ThenThrowsArgumentNullException() |
96
188f8b366e87
Unit test project correctly setup as normal class library DLL.
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
22 { |
107
572886951353
Working tests under StatLight
stevenhollidge <stevenhollidge@hotmail.com>
parents:
106
diff
changeset
|
23 new UserViewModel(null, UserModelValidator.Create()); |
97
1adc1ae981ea
Tests added to SilverlightValidation.Tests
stevenhollidge <stevenhollidge@hotmail.com>
parents:
96
diff
changeset
|
24 } |
1adc1ae981ea
Tests added to SilverlightValidation.Tests
stevenhollidge <stevenhollidge@hotmail.com>
parents:
96
diff
changeset
|
25 |
107
572886951353
Working tests under StatLight
stevenhollidge <stevenhollidge@hotmail.com>
parents:
106
diff
changeset
|
26 [TestMethod] |
572886951353
Working tests under StatLight
stevenhollidge <stevenhollidge@hotmail.com>
parents:
106
diff
changeset
|
27 [ExpectedException(typeof(ArgumentNullException))] |
572886951353
Working tests under StatLight
stevenhollidge <stevenhollidge@hotmail.com>
parents:
106
diff
changeset
|
28 public void WhenConstructed_WithNullSecondParam_ThenThrowsArgumentNullException() |
97
1adc1ae981ea
Tests added to SilverlightValidation.Tests
stevenhollidge <stevenhollidge@hotmail.com>
parents:
96
diff
changeset
|
29 { |
107
572886951353
Working tests under StatLight
stevenhollidge <stevenhollidge@hotmail.com>
parents:
106
diff
changeset
|
30 new UserViewModel(UserModel.Create(), null); |
102
db05a55e3536
INPC tests added
stevenhollidge <stevenhollidge@hotmail.com>
parents:
98
diff
changeset
|
31 } |
db05a55e3536
INPC tests added
stevenhollidge <stevenhollidge@hotmail.com>
parents:
98
diff
changeset
|
32 |
107
572886951353
Working tests under StatLight
stevenhollidge <stevenhollidge@hotmail.com>
parents:
106
diff
changeset
|
33 [TestMethod] |
102
db05a55e3536
INPC tests added
stevenhollidge <stevenhollidge@hotmail.com>
parents:
98
diff
changeset
|
34 public void WhenConstructed_WithGenericParams_ThenInstantiatesViewModel() |
db05a55e3536
INPC tests added
stevenhollidge <stevenhollidge@hotmail.com>
parents:
98
diff
changeset
|
35 { |
db05a55e3536
INPC tests added
stevenhollidge <stevenhollidge@hotmail.com>
parents:
98
diff
changeset
|
36 var vm = new UserViewModel(UserModel.Create(), UserModelValidator.Create()); |
db05a55e3536
INPC tests added
stevenhollidge <stevenhollidge@hotmail.com>
parents:
98
diff
changeset
|
37 Assert.IsNotNull(vm); |
96
188f8b366e87
Unit test project correctly setup as normal class library DLL.
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
38 } |
188f8b366e87
Unit test project correctly setup as normal class library DLL.
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
39 } |
188f8b366e87
Unit test project correctly setup as normal class library DLL.
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
40 } |