Created
May 6, 2012 20:18
-
-
Save anonymous/2624197 to your computer and use it in GitHub Desktop.
ViewModel.Constructor tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using SilverlightValidation.Models; | |
using SilverlightValidation.Validators; | |
using SilverlightValidation.ViewModels; | |
namespace SilverlightValidation.Tests.ViewModels | |
{ | |
[TestClass] | |
public class UserViewModel_Constructor | |
{ | |
[TestMethod] | |
[ExpectedException(typeof(ArgumentNullException))] | |
public void WhenConstructed_WithTwoNulls_ThenThrowsArgumentNullException() | |
{ | |
new UserViewModel(null, null); | |
} | |
[TestMethod] | |
[ExpectedException(typeof(ArgumentNullException))] | |
public void WhenConstructed_WithNullFirstParam_ThenThrowsArgumentNullException() | |
{ | |
new UserViewModel(null, UserModelValidator.Create()); | |
} | |
[TestMethod] | |
[ExpectedException(typeof(ArgumentNullException))] | |
public void WhenConstructed_WithNullSecondParam_ThenThrowsArgumentNullException() | |
{ | |
new UserViewModel(UserModel.Create(), null); | |
} | |
[TestMethod] | |
public void WhenConstructed_WithGenericParams_ThenInstantiatesViewModel() | |
{ | |
var vm = new UserViewModel(UserModel.Create(), UserModelValidator.Create()); | |
Assert.IsNotNull(vm); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment