annotate SilverlightValidation/SilverlightValidation.Tests/Data/FactoryFixture.cs @ 121:8f94475d3146 tip

final code
author stevenh7776
date Thu, 31 May 2012 15:35:26 +0100
parents 11994ccdc50b
children
rev   line source
109
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
1 using Microsoft.VisualStudio.TestTools.UnitTesting;
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
2 using SilverlightValidation.Data;
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
3 using FluentAssertions;
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
4
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
5 namespace SilverlightValidation.Tests.Data
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
6 {
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
7 [TestClass]
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
8 public class FactoryFixture
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
9 {
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
10 [TestMethod]
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
11 public void WhenCreateUserModels_ThenFiveModelsWithUsernameAndPasswordAndEmailSet()
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
12 {
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
13 const int expectedCount = 5;
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
14 var userModels = Factory.CreateUserModels();
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
15
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
16 foreach (var userModel in userModels)
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
17 {
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
18 userModel.Username.Should().NotBeNullOrEmpty();
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
19 userModel.Password.Should().NotBeNullOrEmpty();
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
20 userModel.Email.Should().NotBeNullOrEmpty();
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
21 userModel.DateOfBirth.Should().HaveValue();
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
22 }
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
23
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
24 userModels.Should().HaveCount(expectedCount);
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
25 }
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
26
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
27 }
11994ccdc50b First wave of tests complete
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
28 }