Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1c6ed1bd4b
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (22 sloc) 0.842 kb
using ReactiveXamlSample;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Windows;
namespace ReactiveXamlSample.Tests
{
[TestClass()]
public class AddPersonViewModelTest
{
[TestMethod]
public void OkButtonShouldBeDisabledWhenSomeOfThePropertiesAreInvalid()
{
var target = new AddPersonViewModel();
target.Person = new PersonEntry() {AwesomenessFactor = 50, Name = "Bob", PhoneNumber = "NotAPhoneNumber"};
Assert.IsFalse(target.OkCommand.CanExecute(null));
target.Person.PhoneNumber = "555.333.1222";
Assert.IsTrue(target.OkCommand.CanExecute(null));
target.Person.Name = "";
Assert.IsFalse(target.OkCommand.CanExecute(null));
}
}
}
Jump to Line
Something went wrong with that request. Please try again.