view 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
line wrap: on
line source

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);
        }

    }
}