Permalink
Browse files

Update projects, rename CDTag.ViewModel.Tests to CDTag.ViewModels.Tes…

…ts, add tests for cancel delete profile dialog
  • Loading branch information...
1 parent ae50db4 commit 138d1a4c484104239522730b0a9a76786ea1ac6f @judwhite committed Feb 26, 2012
@@ -109,7 +109,7 @@
<Project>{3FF588D9-76B6-42FC-9664-39E858A940FE}</Project>
<Name>CDTag.Controls</Name>
</ProjectReference>
- <ProjectReference Include="..\CDTag.View.Interfaces\CDTag.Views.Interfaces.csproj">
+ <ProjectReference Include="..\CDTag.Views.Interfaces\CDTag.Views.Interfaces.csproj">
<Project>{B28B82E3-F2AF-455D-A309-C2CE687FD530}</Project>
<Name>CDTag.Views.Interfaces</Name>
</ProjectReference>
@@ -112,7 +112,7 @@
<Project>{5D4DFAF4-4F2D-4713-9F96-7CAB7759E34C}</Project>
<Name>CDTag.Common</Name>
</ProjectReference>
- <ProjectReference Include="..\CDTag.View.Interfaces\CDTag.Views.Interfaces.csproj">
+ <ProjectReference Include="..\CDTag.Views.Interfaces\CDTag.Views.Interfaces.csproj">
<Project>{B28B82E3-F2AF-455D-A309-C2CE687FD530}</Project>
<Name>CDTag.Views.Interfaces</Name>
</ProjectReference>
@@ -130,11 +130,11 @@
<Project>{B72F279B-331E-4F26-9927-FFADB15B7395}</Project>
<Name>CDTag.FileBrowser</Name>
</ProjectReference>
- <ProjectReference Include="..\CDTag.Model\CDTag.Models.csproj">
+ <ProjectReference Include="..\CDTag.Models\CDTag.Models.csproj">
<Project>{24732BDC-95F9-497C-93A9-89634D8C1E06}</Project>
<Name>CDTag.Models</Name>
</ProjectReference>
- <ProjectReference Include="..\CDTag.View.Interfaces\CDTag.Views.Interfaces.csproj">
+ <ProjectReference Include="..\CDTag.Views.Interfaces\CDTag.Views.Interfaces.csproj">
<Project>{B28B82E3-F2AF-455D-A309-C2CE687FD530}</Project>
<Name>CDTag.Views.Interfaces</Name>
</ProjectReference>
@@ -252,15 +252,15 @@
<Project>{B72F279B-331E-4F26-9927-FFADB15B7395}</Project>
<Name>CDTag.FileBrowser</Name>
</ProjectReference>
- <ProjectReference Include="..\CDTag.Model\CDTag.Models.csproj">
+ <ProjectReference Include="..\CDTag.Models\CDTag.Models.csproj">
<Project>{24732BDC-95F9-497C-93A9-89634D8C1E06}</Project>
<Name>CDTag.Models</Name>
</ProjectReference>
- <ProjectReference Include="..\CDTag.View.Interfaces\CDTag.Views.Interfaces.csproj">
+ <ProjectReference Include="..\CDTag.Views.Interfaces\CDTag.Views.Interfaces.csproj">
<Project>{B28B82E3-F2AF-455D-A309-C2CE687FD530}</Project>
<Name>CDTag.Views.Interfaces</Name>
</ProjectReference>
- <ProjectReference Include="..\CDTag.ViewModel\CDTag.ViewModels.csproj">
+ <ProjectReference Include="..\CDTag.ViewModels\CDTag.ViewModels.csproj">
<Project>{5B90F658-10CD-4829-BA0F-FD8B972733C2}</Project>
<Name>CDTag.ViewModels</Name>
</ProjectReference>
View
@@ -31,15 +31,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CDTag", "CDTag", "{C7994747
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CDTag.Common.Tests", "Tests\CDTag.Common.Tests\CDTag.Common.Tests.csproj", "{5A07C950-938C-4B04-84C5-95B4B9896B0D}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CDTag.Views", "CDTag.View\CDTag.Views.csproj", "{0AFCD01F-7FCE-4396-9F3A-13B4EC1C7FBF}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CDTag.Views", "CDTag.Views\CDTag.Views.csproj", "{0AFCD01F-7FCE-4396-9F3A-13B4EC1C7FBF}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CDTag.ViewModels", "CDTag.ViewModel\CDTag.ViewModels.csproj", "{5B90F658-10CD-4829-BA0F-FD8B972733C2}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CDTag.ViewModels", "CDTag.ViewModels\CDTag.ViewModels.csproj", "{5B90F658-10CD-4829-BA0F-FD8B972733C2}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CDTag.Views.Interfaces", "CDTag.View.Interfaces\CDTag.Views.Interfaces.csproj", "{B28B82E3-F2AF-455D-A309-C2CE687FD530}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CDTag.Views.Interfaces", "CDTag.Views.Interfaces\CDTag.Views.Interfaces.csproj", "{B28B82E3-F2AF-455D-A309-C2CE687FD530}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CDTag.Models", "CDTag.Model\CDTag.Models.csproj", "{24732BDC-95F9-497C-93A9-89634D8C1E06}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CDTag.Models", "CDTag.Models\CDTag.Models.csproj", "{24732BDC-95F9-497C-93A9-89634D8C1E06}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CDTag.ViewModels.Tests", "Tests\CDTag.ViewModel.Tests\CDTag.ViewModels.Tests.csproj", "{F6829AE6-D46A-4A17-861D-AA68B0240570}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CDTag.ViewModels.Tests", "Tests\CDTag.ViewModels.Tests\CDTag.ViewModels.Tests.csproj", "{F6829AE6-D46A-4A17-861D-AA68B0240570}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
View
@@ -252,19 +252,19 @@
<Project>{B72F279B-331E-4F26-9927-FFADB15B7395}</Project>
<Name>CDTag.FileBrowser</Name>
</ProjectReference>
- <ProjectReference Include="..\CDTag.Model\CDTag.Models.csproj">
+ <ProjectReference Include="..\CDTag.Models\CDTag.Models.csproj">
<Project>{24732BDC-95F9-497C-93A9-89634D8C1E06}</Project>
<Name>CDTag.Models</Name>
</ProjectReference>
- <ProjectReference Include="..\CDTag.View.Interfaces\CDTag.Views.Interfaces.csproj">
+ <ProjectReference Include="..\CDTag.Views.Interfaces\CDTag.Views.Interfaces.csproj">
<Project>{B28B82E3-F2AF-455D-A309-C2CE687FD530}</Project>
<Name>CDTag.Views.Interfaces</Name>
</ProjectReference>
- <ProjectReference Include="..\CDTag.ViewModel\CDTag.ViewModels.csproj">
+ <ProjectReference Include="..\CDTag.ViewModels\CDTag.ViewModels.csproj">
<Project>{5B90F658-10CD-4829-BA0F-FD8B972733C2}</Project>
<Name>CDTag.ViewModels</Name>
</ProjectReference>
- <ProjectReference Include="..\CDTag.View\CDTag.Views.csproj">
+ <ProjectReference Include="..\CDTag.Views\CDTag.Views.csproj">
<Project>{0AFCD01F-7FCE-4396-9F3A-13B4EC1C7FBF}</Project>
<Name>CDTag.Views</Name>
</ProjectReference>
@@ -58,15 +58,15 @@
<Project>{5D4DFAF4-4F2D-4713-9F96-7CAB7759E34C}</Project>
<Name>CDTag.Common</Name>
</ProjectReference>
- <ProjectReference Include="..\..\CDTag.Model\CDTag.Models.csproj">
+ <ProjectReference Include="..\..\CDTag.Models\CDTag.Models.csproj">
<Project>{24732BDC-95F9-497C-93A9-89634D8C1E06}</Project>
<Name>CDTag.Models</Name>
</ProjectReference>
- <ProjectReference Include="..\..\CDTag.View.Interfaces\CDTag.Views.Interfaces.csproj">
+ <ProjectReference Include="..\..\CDTag.Views.Interfaces\CDTag.Views.Interfaces.csproj">
<Project>{B28B82E3-F2AF-455D-A309-C2CE687FD530}</Project>
<Name>CDTag.Views.Interfaces</Name>
</ProjectReference>
- <ProjectReference Include="..\..\CDTag.ViewModel\CDTag.ViewModels.csproj">
+ <ProjectReference Include="..\..\CDTag.ViewModels\CDTag.ViewModels.csproj">
<Project>{5B90F658-10CD-4829-BA0F-FD8B972733C2}</Project>
<Name>CDTag.ViewModels</Name>
</ProjectReference>
@@ -169,5 +169,65 @@ public void DeleteProfileTest()
Assert.That(File.Exists(_unitTestsProfile2), Is.False, "File.Exists(_unitTestsProfile2)");
Assert.That(File.Exists(_unitTestsProfile3), Is.False, "File.Exists(_unitTestsProfile3)");
}
+
+ [Test]
+ public void DeleteProfileCancelDialogTest()
+ {
+ // Arrange
+ DeleteUnitTestsProfile();
+
+ Assert.That(File.Exists(_unitTestsProfile), Is.False, "File.Exists(_unitTestsProfile)");
+
+ UserProfile profile = new UserProfile();
+ profile.ProfileName = _profileName;
+ profile.Save();
+
+ Assert.That(File.Exists(_unitTestsProfile), Is.True, "File.Exists(_unitTestsProfile)");
+
+ EditProfileViewModel editProfileViewModel = IoC.Resolve<EditProfileViewModel>();
+ bool confirmationShown = false;
+ editProfileViewModel.ShowMessageBox += (sender, args) => { confirmationShown = true; args.Data.Result = MessageBoxResult.No; }; // delete confirmation
+
+ // Assert - initial state
+ Assert.That(editProfileViewModel.Profiles, Is.Not.Null, "editProfileViewModel.Profiles");
+ Assert.That(editProfileViewModel.Profile, Is.Not.Null, "editProfileViewModel.Profile");
+ Assert.That(editProfileViewModel.Profile.ProfileName, Is.EqualTo(_profileName), "editProfileViewModel.Profile.ProfileName");
+ Assert.That(File.Exists(_unitTestsProfile), Is.True, "File.Exists(_unitTestsProfile)");
+ Assert.That(File.Exists(_defaultProfile), Is.False, "File.Exists(_defaultProfile)");
+
+ // Act
+ editProfileViewModel.DeleteProfileCommand.Execute(null);
+
+ // Assert
+ Assert.That(confirmationShown, Is.True, "confirmationShown");
+ Assert.That(editProfileViewModel.Profiles, Is.Not.Null, "editProfileViewModel.Profiles");
+ Assert.That(editProfileViewModel.Profile, Is.Not.Null, "editProfileViewModel.Profile");
+ Assert.That(editProfileViewModel.Profile.ProfileName, Is.EqualTo(_profileName), "editProfileViewModel.Profile.ProfileName");
+ Assert.That(File.Exists(_unitTestsProfile), Is.True, "File.Exists(_unitTestsProfile)");
+ Assert.That(File.Exists(_defaultProfile), Is.False, "File.Exists(_defaultProfile)");
+ }
+
+ [Test]
+ public void DeleteProfileNullTest()
+ {
+ // Arrange
+ DeleteUnitTestsProfile();
+
+ EditProfileViewModel editProfileViewModel = IoC.Resolve<EditProfileViewModel>();
+ bool confirmationShown = false;
+ editProfileViewModel.ShowMessageBox += (sender, args) => { confirmationShown = true; args.Data.Result = MessageBoxResult.Yes; }; // delete confirmation
+
+ // Act
+ editProfileViewModel.Profile = null;
+ editProfileViewModel.DeleteProfileCommand.Execute(null);
+
+ // Assert
+ Assert.That(confirmationShown, Is.False, "confirmationShown");
+ Assert.That(editProfileViewModel.Profiles, Is.Not.Null, "editProfileViewModel.Profiles");
+ Assert.That(editProfileViewModel.Profile, Is.Null, "editProfileViewModel.Profile");
+ //Assert.That(editProfileViewModel.Profile.ProfileName, Is.EqualTo(_profileName), "editProfileViewModel.Profile.ProfileName");
+ Assert.That(File.Exists(_unitTestsProfile), Is.False, "File.Exists(_unitTestsProfile)");
+ Assert.That(File.Exists(_defaultProfile), Is.True, "File.Exists(_defaultProfile)");
+ }
}
}

0 comments on commit 138d1a4

Please sign in to comment.