diff SilverlightValidation/SilverlightValidation.Tests/Data/FactoryFixture.cs @ 109:11994ccdc50b

First wave of tests complete
author stevenhollidge <stevenhollidge@hotmail.com>
date Sun, 06 May 2012 20:37:32 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SilverlightValidation/SilverlightValidation.Tests/Data/FactoryFixture.cs	Sun May 06 20:37:32 2012 +0100
@@ -0,0 +1,28 @@
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using SilverlightValidation.Data;
+using FluentAssertions;
+
+namespace SilverlightValidation.Tests.Data
+{
+    [TestClass]
+    public class FactoryFixture
+    {
+        [TestMethod]
+        public void WhenCreateUserModels_ThenFiveModelsWithUsernameAndPasswordAndEmailSet()
+        {
+            const int expectedCount = 5;
+            var userModels = Factory.CreateUserModels();
+
+            foreach (var userModel in userModels)
+            {
+                userModel.Username.Should().NotBeNullOrEmpty();
+                userModel.Password.Should().NotBeNullOrEmpty();
+                userModel.Email.Should().NotBeNullOrEmpty();
+                userModel.DateOfBirth.Should().HaveValue();
+            }
+
+            userModels.Should().HaveCount(expectedCount);
+        }
+
+    }
+}