# HG changeset patch # User stevenhollidge # Date 1336333052 -3600 # Node ID 11994ccdc50b33b983229b7c8958ae1776dec727 # Parent b728c44d9c613b380e6c92962b4efd3e3b6edd4a First wave of tests complete diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightTest1/App.xaml --- a/SilverlightValidation/SilverlightTest1/App.xaml Sun May 06 16:15:42 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ - - - - - diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightTest1/App.xaml.cs --- a/SilverlightValidation/SilverlightTest1/App.xaml.cs Sun May 06 16:15:42 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -using System; -using System.Windows; -using Microsoft.Silverlight.Testing; - -namespace SilverlightTest1 -{ - public partial class App : Application - { - - public App() - { - this.Startup += this.Application_Startup; - this.Exit += this.Application_Exit; - this.UnhandledException += this.Application_UnhandledException; - - InitializeComponent(); - } - - private void Application_Startup(object sender, StartupEventArgs e) - { - RootVisual = UnitTestSystem.CreateTestPage(); - } - - private void Application_Exit(object sender, EventArgs e) - { - - } - private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) - { - // If the app is running outside of the debugger then report the exception using - // the browser's exception mechanism. On IE this will display it a yellow alert - // icon in the status bar and Firefox will display a script error. - if (!System.Diagnostics.Debugger.IsAttached) - { - - // NOTE: This will allow the application to continue running after an exception has been thrown - // but not handled. - // For production applications this error handling should be replaced with something that will - // report the error to the website and stop the application. - e.Handled = true; - Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); }); - } - } - private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) - { - try - { - string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; - errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); - - System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");"); - } - catch (Exception) - { - } - } - } -} \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightTest1/Properties/AppManifest.xml --- a/SilverlightValidation/SilverlightTest1/Properties/AppManifest.xml Sun May 06 16:15:42 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - - - - - diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightTest1/Properties/AssemblyInfo.cs --- a/SilverlightValidation/SilverlightTest1/Properties/AssemblyInfo.cs Sun May 06 16:15:42 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -// Copyright © 2012 - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SilverlightTest1")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SilverlightTest1")] -[assembly: AssemblyCopyright("Copyright © 2012")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("742825e3-6631-4dc4-95b8-9506052f7ed9")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightTest1/SilverlightTest1.csproj --- a/SilverlightValidation/SilverlightTest1/SilverlightTest1.csproj Sun May 06 16:15:42 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {AA0B1C80-97AE-49F5-8310-5A7683BE47BF} - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - SilverlightTest1 - SilverlightTest1 - Silverlight - v5.0 - $(TargetFrameworkVersion) - true - - true - true - SilverlightTest1.xap - Properties\AppManifest.xml - SilverlightTest1.App - TestPage.html - true - true - false - Properties\OutOfBrowserSettings.xml - false - true - - - - - - - v3.5 - - - true - full - false - Bin\Debug - DEBUG;TRACE;SILVERLIGHT - true - true - prompt - 4 - - - pdbonly - true - Bin\Release - TRACE;SILVERLIGHT - true - true - prompt - 4 - - - - $(MSBuildExtensionsPath)\..\Microsoft SDKs\Silverlight\v4.0\Toolkit\Apr10\Testing\Microsoft.Silverlight.Testing.dll - - - $(MSBuildExtensionsPath)\..\Microsoft SDKs\Silverlight\v4.0\Toolkit\Apr10\Testing\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - - - - - - - - App.xaml - - - - - - - Designer - MSBuild:Compile - - - - - - - - - - - - - - - - \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightTest1/Tests.cs --- a/SilverlightValidation/SilverlightTest1/Tests.cs Sun May 06 16:15:42 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -using System; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Shapes; -using Microsoft.Silverlight.Testing; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace SilverlightTest1 -{ - [TestClass] - public class Tests - { - [TestMethod] - public void TestMethod1() - { - } - } -} \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/Log/SilverlightValidation.AutomatedTests.pjs.tcLogs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/Log/SilverlightValidation.AutomatedTests.pjs.tcLogs Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + +]> + + + + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests.pjs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests.pjs Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests.pjs.tcLS --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests.pjs.tcLS Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests.tcCfgExtender --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests.tcCfgExtender Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/KeywordTests.tcKDT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/KeywordTests.tcKDT Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Test1.tcKDTest --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Test1.tcKDTest Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Test2.tcKDTest --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Test2.tcKDTest Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test1_tcKDTest/Test1.tcKDTest.tcVis --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test1_tcKDTest/Test1.tcKDTest.tcVis Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + +]> + + + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/Test2.tcKDTest.tcVis --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/Test2.tcKDTest.tcVis Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + +]> + + + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi17040.png Binary file SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi17040.png has changed diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi17040.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi17040.xml Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,516 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sets focus to the specified Window object. + + +Closes the specified Window object. + + +Sets the specified position and size for the specific Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +1600 + + +40 + + +True + + + + + + + + + + + + + + + + + + + + + + + + + +Sets focus to the specified Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +268 + + +40 + + +True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sets focus to the specified Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +79 + + +38 + + +True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sets focus to the specified Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +15 + + +40 + + +True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0 +Specifies the logical position of the pager control, between wMin and wMax. + + +Sets focus to the specified Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +174 + + +38 + + +True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Simulates a click on Item specified by index from 0 or by name, with shift keys in the state specified by Shift. + + +7 +Returns the total number of buttons in the tool bar control. + + +Returns the name of the button specified by Item, which is position from 0 by default, or idCommand number if ByPosition is specified as False. + + +Sets focus to the specified Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +174 + + +38 + + +True + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sets focus to the specified Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +1278 + + +40 + + +True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sets focus to the specified Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +1276 + + +40 + + +True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sets focus to the specified Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +1276 + + +40 + + +True + + + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi29840.png Binary file SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi29840.png has changed diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi29840.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi29840.xml Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sets focus to the specified Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +1600 + + +763 + + +True + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi29841.png Binary file SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi29841.png has changed diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi29841.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi29841.xml Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sets focus to the specified Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +1600 + + +763 + + +True + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi34560.png Binary file SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi34560.png has changed diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi34560.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi34560.xml Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,285 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sets focus to the specified Window object. + + +Closes the specified Window object. + + +Sets the specified position and size for the specific Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +363 + + +161 + + +True + + + + + + + + + + + + + + + + + + + + + + + + + + + +Performs a single click on the specified button. + + +Sets focus to the specified Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +88 + + +26 + + +True + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Performs a single click on the specified button. + + +Sets focus to the specified Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +88 + + +26 + + +True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sets focus to the specified Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +32 + + +32 + + +True + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sets focus to the specified Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +256 + + +17 + + +True + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi34561.png Binary file SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi34561.png has changed diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi34561.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/KeywordTests/Visualizer/Test2_tcKDTest/tcvi34561.xml Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,292 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sets focus to the specified Window object. + + +Closes the specified Window object. + + +Sets the specified position and size for the specific Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +1175 + + +526 + + +True + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sets focus to the specified Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +1159 + + +401 + + +True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sets focus to the specified Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +1159 + + +401 + + +True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sets focus to the specified Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +1159 + + +401 + + +True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sets focus to the specified Window object. + + +Simulates a left-button single click in a window or control as specified (relative position, shift keys). + + +Simulates a right-button single click in a window or control as specified (relative position, shift keys). + + +Simulates one or several keypresses. + + +True + + +830 + + +25 + + +True + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/Log/SilverlightValidation.AutomatedTests.mds.tcLogs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/Log/SilverlightValidation.AutomatedTests.mds.tcLogs Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + +]> + + + + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/NameMapping/NameMapping.tcNM --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/NameMapping/NameMapping.tcNM Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/Script/Script.tcScript --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/Script/Script.tcScript Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/Script/Unit1.sj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/Script/Unit1.sj Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,1 @@ +ÿþ \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/Script/Visualizer/Unit1_sj/Unit1.sj.tcVis --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/Script/Visualizer/Unit1_sj/Unit1.sj.tcVis Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + +]> + + + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests.mds --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests.mds Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,1857 @@ + + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests.mds.tcLS --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests.mds.tcLS Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/Stores/Stores.tcStores --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/Stores/Stores.tcStores Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/Stores/WebTesting/WebTesting.tcWtc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/Stores/WebTesting/WebTesting.tcWtc Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/TestedApps/TestedApps.tcTAs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.AutomatedTests/SilverlightValidation.AutomatedTests/TestedApps/TestedApps.tcTAs Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.PL/Models/UserModel.cs --- a/SilverlightValidation/SilverlightValidation.PL/Models/UserModel.cs Sun May 06 16:15:42 2012 +0100 +++ b/SilverlightValidation/SilverlightValidation.PL/Models/UserModel.cs Sun May 06 20:37:32 2012 +0100 @@ -21,11 +21,11 @@ { return new UserModel() { - Username = "", - Password = "", - Email = "", - DateOfBirth = null, - Description = "" + Username = username, + Password = password, + Email = email, + DateOfBirth = dateOfBirth, + Description = descripton }; } diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.Tests.NUnit/Fakes/UserModelValidatorFake.cs --- a/SilverlightValidation/SilverlightValidation.Tests.NUnit/Fakes/UserModelValidatorFake.cs Sun May 06 16:15:42 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -using System; -using FluentValidation; -using SilverlightValidation.Interfaces; - -namespace SilverlightValidation.Tests.Fakes -{ - class UserModelValidatorFake : AbstractValidator - { - private UserModelValidatorFake() - { - RuleFor(x => x.Username) - .Length(3, 8) - .WithMessage("Must be between 3-8 characters."); - - RuleFor(x => x.Password) - .Matches(@"^\w*(?=\w*\d)(?=\w*[a-z])(?=\w*[A-Z])\w*$") - .WithMessage("Must contain lower, upper and numeric chars."); - - RuleFor(x => x.Email) - .EmailAddress() - .WithMessage("A valid email address is required."); - - RuleFor(x => x.DateOfBirth) - .Must(BeAValidDateOfBirth) - .WithMessage("Must be within 100 years of today."); - } - - private bool BeAValidDateOfBirth(DateTime? dateOfBirth) - { - if (dateOfBirth == null) return false; - if (dateOfBirth.Value > DateTime.Today || dateOfBirth < DateTime.Today.AddYears(-100)) - return false; - return true; - } - - public static UserModelValidatorFake Create() { return new UserModelValidatorFake(); } - } -} diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.Tests.NUnit/Properties/AssemblyInfo.cs --- a/SilverlightValidation/SilverlightValidation.Tests.NUnit/Properties/AssemblyInfo.cs Sun May 06 16:15:42 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SilverlightValidation.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SilverlightValidation.Tests")] -[assembly: AssemblyCopyright("Copyright © 2012")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("843ea0ec-635f-4592-b3e6-5893be73bc5e")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.Tests.NUnit/SilverlightValidation.Tests.csproj --- a/SilverlightValidation/SilverlightValidation.Tests.NUnit/SilverlightValidation.Tests.csproj Sun May 06 16:15:42 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {02CCF8C7-1311-453F-BF82-3564AD9E7B8C} - Library - Properties - SilverlightValidation.Tests - SilverlightValidation.Tests - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\Libs\FakeItEasy.dll - - - ..\Libs\FluentAssertions.dll - - - ..\Libs\FluentValidation.dll - - - ..\Libs\nunit.framework.dll - - - - - ..\Libs\System.Windows.dll - - - - - - - - - - - - - - - - - {13B5F568-F402-4A2A-9A23-0FDF0B5564E3} - SilverlightValidation.PL - - - - - - - - \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.Tests.NUnit/ViewModels/UserListViewModelFixture.cs --- a/SilverlightValidation/SilverlightValidation.Tests.NUnit/ViewModels/UserListViewModelFixture.cs Sun May 06 16:15:42 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -using System; -using NUnit.Framework; - -namespace SilverlightValidation.Tests.ViewModels -{ - [TestFixture] - class UserListViewModelFixture - { - [Test] - public void Given_When_Then() - { - Assert.True(true); - } - } -} diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.Tests.NUnit/ViewModels/UserViewModelFixture.cs --- a/SilverlightValidation/SilverlightValidation.Tests.NUnit/ViewModels/UserViewModelFixture.cs Sun May 06 16:15:42 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,222 +0,0 @@ -using System; -using FluentAssertions.EventMonitoring; -using NUnit.Framework; -using SilverlightValidation.Models; -using SilverlightValidation.Tests.Fakes; -using SilverlightValidation.Validators; -using SilverlightValidation.ViewModels; - -namespace SilverlightValidation.Tests.ViewModels -{ - [TestFixture] - class UserViewModelFixture - { - #region Constructor - - [Test] - public void WhenConstructed_WithTwoNulls_ThenArgumentNullExceptionForModel() - { - Assert.Throws(() => new UserViewModel(null, null), "model"); - } - - [Test] - public void WhenConstructed_WithNullFirstParam_ThenArgumentNullExceptionForModel() - { - Assert.Throws(() => new UserViewModel(null, UserModelValidator.Create()), "model"); - } - - [Test] - public void WhenConstructed_WithNullSecondParam_ThenArgumentNullExceptionForValidator() - { - Assert.Throws(() => new UserViewModel(UserModel.Create(), null), "validator"); - } - - [Test] - public void WhenConstructed_WithGenericParams_ThenInstantiatesViewModel() - { - var vm = new UserViewModel(UserModel.Create(), UserModelValidator.Create()); - Assert.IsNotNull(vm); - } - - #endregion - - #region INotifyPropertyChanged - - [Test] - public void WhenPropertyChanged_WithValidDateOfBirthUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // act - vm.DateOfBirth = new DateTime(1977, 01, 01); - - // assert - vm.ShouldRaisePropertyChangeFor(x => x.DateOfBirth); - Assert.IsTrue(vm.IsChanged); - } - - - [Test] - public void WhenPropertyChanged_WithInvalidDateOfBirthUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // act - vm.DateOfBirth = new DateTime(1800, 01, 01); - - // assert - vm.ShouldRaisePropertyChangeFor(x => x.DateOfBirth); - Assert.IsTrue(vm.IsChanged); - } - - [Test] - public void WhenPropertyChanged_WithDescriptionUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // act - vm.Description = "New description"; - - // assert - vm.ShouldRaisePropertyChangeFor(x => x.Description); - Assert.IsTrue(vm.IsChanged); - } - - [Test] - public void WhenPropertyChanged_WithValidEmailUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // act - vm.Email = "test@domain.com"; - - // assert - vm.ShouldRaisePropertyChangeFor(x => x.Email); - Assert.IsTrue(vm.IsChanged); - } - - [Test] - public void WhenPropertyChanged_WithInvalidEmailUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // act - vm.Email = "invalid email"; - - // assert - vm.ShouldRaisePropertyChangeFor(x => x.Email); - Assert.IsTrue(vm.IsChanged); - } - - [Test] - public void WhenPropertyChanged_WithValidUsernameUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // act - vm.Username = "dummy"; - - // assert - vm.ShouldRaisePropertyChangeFor(x => x.Username); - Assert.IsTrue(vm.IsChanged); - } - - [Test] - public void WhenPropertyChanged_WithInvalidUsernameUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // act - vm.Username = "invalidusernametoolong"; - - // assert - vm.ShouldRaisePropertyChangeFor(x => x.Username); - Assert.IsTrue(vm.IsChanged); - } - - [Test] - public void WhenPropertyChanged_WithValidPasswordUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // act - vm.Password = "dummy"; - - // assert - vm.ShouldRaisePropertyChangeFor(x => x.Password); - Assert.IsTrue(vm.IsChanged); - } - - [Test] - public void WhenPropertyChanged_WithInvalidPasswordUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // act - vm.Password = "invalidpasswordtoolong"; - - // assert - vm.ShouldRaisePropertyChangeFor(x => x.Password); - Assert.IsTrue(vm.IsChanged); - } - - #endregion - - #region Commands - - [Test] - public void WhenNewViewModel_ThenOkCommandIsExecutable() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // assert - Assert.IsTrue(vm.OkCommand.CanExecute(null)); - } - - [Test] - public void WhenNewViewModel_ThenCancelCommandIsExecutable() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // assert - Assert.IsTrue(vm.CancelCommand.CanExecute(null)); - } - - [Test] - public void WhenNewViewModel_WithCancelExecuted_ThenShouldRaiseEvent() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // act - vm.CancelCommand.Execute(null); - - // assert - vm.ShouldRaise("UserViewResponseMessage"); - } - - #endregion - - #region Helpers - - private static UserViewModel CreateDefaultUserViewModel() - { - var vm = new UserViewModel(UserModel.Create(), UserModelValidatorFake.Create()); - vm.MonitorEvents(); - return vm; - } - - #endregion - } -} diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.Tests.NUnit/ViewModels/ViewModelBaseFixture.cs --- a/SilverlightValidation/SilverlightValidation.Tests.NUnit/ViewModels/ViewModelBaseFixture.cs Sun May 06 16:15:42 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using NUnit.Framework; - -namespace SilverlightValidation.Tests.ViewModels -{ - [TestFixture] - class ViewModelBaseFixture - { - - } -} diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.Tests.NUnit/packages.config --- a/SilverlightValidation/SilverlightValidation.Tests.NUnit/packages.config Sun May 06 16:15:42 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.Tests/Data/FactoryFixture.cs --- /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); + } + + } +} diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.Tests/Helpers/Helper.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.Tests/Helpers/Helper.cs Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,32 @@ +using System; +using FluentAssertions.EventMonitoring; +using SilverlightValidation.Models; +using SilverlightValidation.Tests.Fakes; +using SilverlightValidation.ViewModels; + +namespace SilverlightValidation.Tests.Helpers +{ + public class Helper + { + public static UserViewModel CreateDefaultUserViewModel() + { + var vm = new UserViewModel(UserModel.Create(), UserModelValidatorFake.Create()); + vm.MonitorEvents(); + return vm; + } + + public static UserViewModel CreateInvalidUserViewModel() + { + var vm = new UserViewModel(UserModel.Create(), UserModelValidatorFake.Create()); + vm.MonitorEvents(); + return vm; + } + + public static UserViewModel CreateValidUserViewModel() + { + var vm = new UserViewModel(UserModel.Create("dummy", "Dummy1", "dummy@dummy.com", new DateTime(1977, 01, 01)), UserModelValidatorFake.Create()); + vm.MonitorEvents(); + return vm; + } + } +} diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.Tests/SilverlightValidation.Tests.csproj --- a/SilverlightValidation/SilverlightValidation.Tests/SilverlightValidation.Tests.csproj Sun May 06 16:15:42 2012 +0100 +++ b/SilverlightValidation/SilverlightValidation.Tests/SilverlightValidation.Tests.csproj Sun May 06 20:37:32 2012 +0100 @@ -128,10 +128,15 @@ App.xaml + + - + + + + diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.Tests/ViewModels/UserViewModelFixture.cs --- a/SilverlightValidation/SilverlightValidation.Tests/ViewModels/UserViewModelFixture.cs Sun May 06 16:15:42 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,229 +0,0 @@ -using System; -using FluentAssertions.EventMonitoring; -using GalaSoft.MvvmLight.Messaging; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SilverlightValidation.Messages; -using SilverlightValidation.Models; -using SilverlightValidation.Tests.Fakes; -using SilverlightValidation.Validators; -using SilverlightValidation.ViewModels; - -namespace SilverlightValidation.Tests.ViewModels -{ - [TestClass] - public class UserViewModelFixture - { - #region 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); - } - - #endregion - - #region INotifyPropertyChanged - - [TestMethod] - public void WhenPropertyChanged_WithValidDateOfBirthUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // act - vm.DateOfBirth = new DateTime(1977, 01, 01); - - // assert - vm.ShouldRaisePropertyChangeFor(x => x.DateOfBirth); - Assert.IsTrue(vm.IsChanged); - } - - - [TestMethod] - public void WhenPropertyChanged_WithInvalidDateOfBirthUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // act - vm.DateOfBirth = new DateTime(1800, 01, 01); - - // assert - vm.ShouldRaisePropertyChangeFor(x => x.DateOfBirth); - Assert.IsTrue(vm.IsChanged); - } - - [TestMethod] - public void WhenPropertyChanged_WithDescriptionUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // act - vm.Description = "New description"; - - // assert - vm.ShouldRaisePropertyChangeFor(x => x.Description); - Assert.IsTrue(vm.IsChanged); - } - - [TestMethod] - public void WhenPropertyChanged_WithValidEmailUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // act - vm.Email = "test@domain.com"; - - // assert - vm.ShouldRaisePropertyChangeFor(x => x.Email); - Assert.IsTrue(vm.IsChanged); - } - - [TestMethod] - public void WhenPropertyChanged_WithInvalidEmailUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // act - vm.Email = "invalid email"; - - // assert - vm.ShouldRaisePropertyChangeFor(x => x.Email); - Assert.IsTrue(vm.IsChanged); - } - - [TestMethod] - public void WhenPropertyChanged_WithValidUsernameUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // act - vm.Username = "dummy"; - - // assert - vm.ShouldRaisePropertyChangeFor(x => x.Username); - Assert.IsTrue(vm.IsChanged); - } - - [TestMethod] - public void WhenPropertyChanged_WithInvalidUsernameUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // act - vm.Username = "invalidusernametoolong"; - - // assert - vm.ShouldRaisePropertyChangeFor(x => x.Username); - Assert.IsTrue(vm.IsChanged); - } - - [TestMethod] - public void WhenPropertyChanged_WithValidPasswordUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // act - vm.Password = "dummy"; - - // assert - vm.ShouldRaisePropertyChangeFor(x => x.Password); - Assert.IsTrue(vm.IsChanged); - } - - [TestMethod] - public void WhenPropertyChanged_WithInvalidPasswordUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // act - vm.Password = "invalidpasswordtoolong"; - - // assert - vm.ShouldRaisePropertyChangeFor(x => x.Password); - Assert.IsTrue(vm.IsChanged); - } - - #endregion - - #region Commands - - [TestMethod] - public void WhenNewViewModel_ThenOkCommandIsExecutable() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // assert - Assert.IsTrue(vm.OkCommand.CanExecute(null)); - } - - [TestMethod] - public void WhenNewViewModel_ThenCancelCommandIsExecutable() - { - // arrange - var vm = CreateDefaultUserViewModel(); - - // assert - Assert.IsTrue(vm.CancelCommand.CanExecute(null)); - } - - [TestMethod] - public void WhenNewViewModel_WithCancelExecuted_ThenShouldRaiseEvent() - { - // arrange - var vm = CreateDefaultUserViewModel(); - bool hasMessage = false; - Messenger.Default.Register(this, message => { hasMessage = true; }); - - // act - vm.CancelCommand.Execute(null); - - // assert - Assert.IsTrue(hasMessage); - } - - #endregion - - #region Helpers - - private static UserViewModel CreateDefaultUserViewModel() - { - var vm = new UserViewModel(UserModel.Create(), UserModelValidatorFake.Create()); - vm.MonitorEvents(); - return vm; - } - - #endregion - } -} diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.Tests/ViewModels/UserViewModel_Commands.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.Tests/ViewModels/UserViewModel_Commands.cs Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,96 @@ +using GalaSoft.MvvmLight.Messaging; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using SilverlightValidation.Messages; +using SilverlightValidation.Tests.Helpers; + +namespace SilverlightValidation.Tests.ViewModels +{ + [TestClass] + public class UserViewModel_Commands + { + [TestMethod] + public void WhenNewViewModel_ThenOkCommandIsExecutable() + { + // arrange + var vm = Helper.CreateDefaultUserViewModel(); + + // assert + Assert.IsTrue(vm.OkCommand.CanExecute(null)); + } + + [TestMethod] + public void WhenNewViewModel_WithOkExecuted_ThenShouldNotRaiseEvent() + { + // arrange + var vm = Helper.CreateDefaultUserViewModel(); + bool hasMessage = false; + Messenger.Default.Register(this, message => { hasMessage = true; }); + + // act + vm.OkCommand.Execute(null); + + // assert + Assert.IsFalse(hasMessage); + } + + [TestMethod] + public void WhenNewViewModel_WithOkExecutedAndUsernameUpdatedWithInvalidData_ThenShouldNotRaiseEvent() + { + // arrange + var vm = Helper.CreateDefaultUserViewModel(); + bool hasMessage = false; + Messenger.Default.Register(this, message => { hasMessage = true; }); + + // act + var shortData = "a"; + vm.Username = shortData; + vm.OkCommand.Execute(null); + + // assert + Assert.IsFalse(hasMessage); + } + + [TestMethod] + public void WhenNewViewModel_WithOkExecutedAndUsernameUpdated_ThenShouldRaiseEvent() + { + // arrange + var vm = Helper.CreateValidUserViewModel(); + bool hasMessage = false; + Messenger.Default.Register(this, message => { hasMessage = true; }); + + // act + vm.Username = "updated"; + vm.OkCommand.Execute(null); + + // assert + Assert.IsTrue(vm.IsChanged); + Assert.IsTrue(hasMessage); + } + + [TestMethod] + public void WhenNewViewModel_ThenCancelCommandIsExecutable() + { + // arrange + var vm = Helper.CreateDefaultUserViewModel(); + + // assert + Assert.IsTrue(vm.CancelCommand.CanExecute(null)); + } + + [TestMethod] + public void WhenNewViewModel_WithCancelExecuted_ThenShouldRaiseEvent() + { + // arrange + var vm = Helper.CreateDefaultUserViewModel(); + bool hasMessage = false; + Messenger.Default.Register(this, message => { hasMessage = true; }); + + // act + vm.CancelCommand.Execute(null); + + // assert + Assert.IsTrue(hasMessage); + } + + } +} diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.Tests/ViewModels/UserViewModel_Constructor.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.Tests/ViewModels/UserViewModel_Constructor.cs Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,40 @@ +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); + } + } +} diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.Tests/ViewModels/UserViewModel_INotifyDataErrorInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.Tests/ViewModels/UserViewModel_INotifyDataErrorInfo.cs Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,271 @@ +using System; +using FluentAssertions; +using SilverlightValidation.Tests.Helpers; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace SilverlightValidation.Tests.ViewModels +{ + [TestClass] + public class UserViewModel_INotifyDataErrorInfo + { + [TestMethod] + public void WhenValidVM_WithUpdatedUsername_WithValidData_ThenErrorsForUsernameEmpty() + { + // arrange + var vm = Helper.CreateValidUserViewModel(); + + // act + var validData = "valid"; + vm.Username = validData; + + // assert + Assert.IsFalse(vm.HasErrors); + vm.GetErrors("Username").Should().BeNull(); + } + + [TestMethod] + public void WhenValidVM_WithUpdatedUsername_WithInvalidEmptyData_ThenErrorsForUsernameEqualsOne() + { + // arrange + var vm = Helper.CreateValidUserViewModel(); + + // act + vm.Username = string.Empty; + + // assert + Assert.IsTrue(vm.HasErrors); + vm.GetErrors("Username").Should().HaveCount(1); + } + + [TestMethod] + public void WhenValidVM_WithUpdatedUsername_WithInvalidShortData_ThenErrorsForUsernameEqualsOne() + { + // arrange + var vm = Helper.CreateValidUserViewModel(); + + // act + var shortData = "a"; + vm.Username = shortData; + + // assert + Assert.IsTrue(vm.HasErrors); + vm.GetErrors("Username").Should().HaveCount(1); + } + + [TestMethod] + public void WhenValidVM_WithUpdatedUsername_WithInvalidLongData_ThenErrorsForUsernameEqualsOne() + { + // arrange + var vm = Helper.CreateValidUserViewModel(); + + // act + vm.Username = "thisdatashouldbetoolong"; + + // assert + Assert.IsTrue(vm.HasErrors); + vm.GetErrors("Username").Should().HaveCount(1); + } + + [TestMethod] + public void WhenValidVM_WithUpdatedPassword_WithValidData_ThenErrorsForPasswordEmpty() + { + // arrange + var vm = Helper.CreateValidUserViewModel(); + + // act + var validPassword = "Pa33word"; + vm.Password = validPassword; + + // assert + Assert.IsFalse(vm.HasErrors); + vm.GetErrors("Password").Should().BeNull(); + } + + [TestMethod] + public void WhenValidVM_WithUpdatedPassword_WithInvalidEmptyData_ThenErrorsForPasswordEqualsOne() + { + // arrange + var vm = Helper.CreateValidUserViewModel(); + + // act + vm.Password = string.Empty; + + // assert + Assert.IsTrue(vm.HasErrors); + vm.GetErrors("Password").Should().HaveCount(1); + } + + [TestMethod] + public void WhenValidVM_WithUpdatedPassword_WithInvalidDataNotContainingANumber_ThenErrorsForPasswordEqualsOne() + { + // arrange + var vm = Helper.CreateValidUserViewModel(); + + // act + vm.Password = "Password"; + + // assert + Assert.IsTrue(vm.HasErrors); + vm.GetErrors("Password").Should().HaveCount(1); + } + + [TestMethod] + public void WhenValidVM_WithUpdatedPassword_WithInvalidDataNotContainingAnUpperCaseLetter_ThenErrorsForPasswordEqualsOne() + { + // arrange + var vm = Helper.CreateValidUserViewModel(); + + // act + vm.Password = "pa33word"; + + // assert + Assert.IsTrue(vm.HasErrors); + vm.GetErrors("Password").Should().HaveCount(1); + } + + [TestMethod] + public void WhenValidVM_WithUpdatedPassword_WithInvalidDataNotContainingALowerCaseLetter_ThenErrorsForPasswordEqualsOne() + { + // arrange + var vm = Helper.CreateValidUserViewModel(); + + // act + vm.Password = "PA33WORD"; + + // assert + Assert.IsTrue(vm.HasErrors); + vm.GetErrors("Password").Should().HaveCount(1); + } + + [TestMethod] + public void WhenValidVM_WithUpdatedEmail_WithValidData_ThenErrorsForEmailEmpty() + { + // arrange + var vm = Helper.CreateValidUserViewModel(); + + // act + var validData = "valid@email.com"; + vm.Email = validData; + + // assert + Assert.IsFalse(vm.HasErrors); + vm.GetErrors("Email").Should().BeNull(); + } + + [TestMethod] + public void WhenValidVM_WithUpdatedEmail_WithInvalidEmptyData_ThenErrorsForEmailEqualsOne() + { + // arrange + var vm = Helper.CreateValidUserViewModel(); + + // act + vm.Email = string.Empty; + + // assert + Assert.IsTrue(vm.HasErrors); + vm.GetErrors("Email").Should().HaveCount(1); + } + + [TestMethod] + public void WhenValidVM_WithUpdatedEmail_WithInvalidDataNoAtSign_ThenErrorsForEmailEqualsOne() + { + // arrange + var vm = Helper.CreateValidUserViewModel(); + + // act + var noAtSign = "invalidemail.com"; + vm.Email = noAtSign; + + // assert + Assert.IsTrue(vm.HasErrors); + vm.GetErrors("Email").Should().HaveCount(1); + } + + [TestMethod] + public void WhenValidVM_WithUpdatedEmail_WithInvalidDataNothingBeforeAtSign_ThenErrorsForEmailEqualsOne() + { + // arrange + var vm = Helper.CreateValidUserViewModel(); + + // act + var nothingBeforeAtSign = "@email.com"; + vm.Email = nothingBeforeAtSign; + + // assert + Assert.IsTrue(vm.HasErrors); + vm.GetErrors("Email").Should().HaveCount(1); + } + + [TestMethod] + public void WhenValidVM_WithUpdatedEmail_WithInvalidDataNoDotAfterAtSign_ThenErrorsForEmailEqualsOne() + { + // arrange + var vm = Helper.CreateValidUserViewModel(); + + // act + vm.Email = "invalid@email"; + + // assert + Assert.IsTrue(vm.HasErrors); + vm.GetErrors("Email").Should().HaveCount(1); + } + + [TestMethod] + public void WhenValidVM_WithUpdatedDateOfBirth_WithValidData_ThenErrorsForDateOfBirthEmpty() + { + // arrange + var vm = Helper.CreateValidUserViewModel(); + + // act + var validData = new DateTime(1977, 01, 01); + vm.DateOfBirth = validData; + + // assert + Assert.IsFalse(vm.HasErrors); + vm.GetErrors("DateOfBirth").Should().BeNull(); + } + + [TestMethod] + public void WhenValidVM_WithUpdatedDateOfBirth_WithInvalidEarlyData_ThenErrorsForDateOfBirthEqualsOne() + { + // arrange + var vm = Helper.CreateValidUserViewModel(); + + // act + vm.DateOfBirth = DateTime.MinValue; + + // assert + Assert.IsTrue(vm.HasErrors); + vm.GetErrors("DateOfBirth").Should().HaveCount(1); + } + + [TestMethod] + public void WhenValidVM_WithUpdatedDateOfBirth_WithInvalidDataMaxDate_ThenErrorsForDateOfBirthEqualsOne() + { + // arrange + var vm = Helper.CreateValidUserViewModel(); + + // act + vm.DateOfBirth = DateTime.MaxValue; + + // assert + Assert.IsTrue(vm.HasErrors); + vm.GetErrors("DateOfBirth").Should().HaveCount(1); + } + + [TestMethod] + public void WhenValidVM_WithUpdatedDateOfBirth_WithInvalidDataTomorrow_ThenErrorsForDateOfBirthEqualsOne() + { + // arrange + var vm = Helper.CreateValidUserViewModel(); + + // act + vm.DateOfBirth = DateTime.Now.AddDays(1); + + // assert + Assert.IsTrue(vm.HasErrors); + vm.GetErrors("DateOfBirth").Should().HaveCount(1); + } + + } +} \ No newline at end of file diff -r b728c44d9c61 -r 11994ccdc50b SilverlightValidation/SilverlightValidation.Tests/ViewModels/UserViewModel_INotifyPropertyChanged.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightValidation/SilverlightValidation.Tests/ViewModels/UserViewModel_INotifyPropertyChanged.cs Sun May 06 20:37:32 2012 +0100 @@ -0,0 +1,137 @@ +using System; +using FluentAssertions.EventMonitoring; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using SilverlightValidation.Tests.Helpers; + +namespace SilverlightValidation.Tests.ViewModels +{ + [TestClass] + public class UserViewModel_INotifyPropertyChanged + { + [TestMethod] + public void WhenPropertyChanged_WithValidDateOfBirthUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() + { + // arrange + var vm = Helper.CreateDefaultUserViewModel(); + + // act + vm.DateOfBirth = new DateTime(1977, 01, 01); + + // assert + vm.ShouldRaisePropertyChangeFor(x => x.DateOfBirth); + Assert.IsTrue(vm.IsChanged); + } + + [TestMethod] + public void WhenPropertyChanged_WithInvalidDateOfBirthUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() + { + // arrange + var vm = Helper.CreateDefaultUserViewModel(); + + // act + vm.DateOfBirth = new DateTime(1800, 01, 01); + + // assert + vm.ShouldRaisePropertyChangeFor(x => x.DateOfBirth); + Assert.IsTrue(vm.IsChanged); + } + + [TestMethod] + public void WhenPropertyChanged_WithDescriptionUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() + { + // arrange + var vm = Helper.CreateDefaultUserViewModel(); + + // act + vm.Description = "New description"; + + // assert + vm.ShouldRaisePropertyChangeFor(x => x.Description); + Assert.IsTrue(vm.IsChanged); + } + + [TestMethod] + public void WhenPropertyChanged_WithValidEmailUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() + { + // arrange + var vm = Helper.CreateDefaultUserViewModel(); + + // act + vm.Email = "test@domain.com"; + + // assert + vm.ShouldRaisePropertyChangeFor(x => x.Email); + Assert.IsTrue(vm.IsChanged); + } + + [TestMethod] + public void WhenPropertyChanged_WithInvalidEmailUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() + { + // arrange + var vm = Helper.CreateDefaultUserViewModel(); + + // act + vm.Email = "invalid email"; + + // assert + vm.ShouldRaisePropertyChangeFor(x => x.Email); + Assert.IsTrue(vm.IsChanged); + } + + [TestMethod] + public void WhenPropertyChanged_WithValidUsernameUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() + { + // arrange + var vm = Helper.CreateDefaultUserViewModel(); + + // act + vm.Username = "dummy"; + + // assert + vm.ShouldRaisePropertyChangeFor(x => x.Username); + Assert.IsTrue(vm.IsChanged); + } + + [TestMethod] + public void WhenPropertyChanged_WithInvalidUsernameUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() + { + // arrange + var vm = Helper.CreateDefaultUserViewModel(); + + // act + vm.Username = "invalidusernametoolong"; + + // assert + vm.ShouldRaisePropertyChangeFor(x => x.Username); + Assert.IsTrue(vm.IsChanged); + } + + [TestMethod] + public void WhenPropertyChanged_WithValidPasswordUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() + { + // arrange + var vm = Helper.CreateDefaultUserViewModel(); + + // act + vm.Password = "dummy"; + + // assert + vm.ShouldRaisePropertyChangeFor(x => x.Password); + Assert.IsTrue(vm.IsChanged); + } + + [TestMethod] + public void WhenPropertyChanged_WithInvalidPasswordUpdated_ThenFiresChangeEventAndIsChangedEqualsTrue() + { + // arrange + var vm = Helper.CreateDefaultUserViewModel(); + + // act + vm.Password = "invalidpasswordtoolong"; + + // assert + vm.ShouldRaisePropertyChangeFor(x => x.Password); + Assert.IsTrue(vm.IsChanged); + } + } +}