PageRenderTime 46ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/V1/trunk/Source/QuickStarts/Modularity/Modularity.Tests.AcceptanceTests/AutomatedTests/DirectoryLookupModularity/ModuleFixtures/DirectoryLookupModularityModuleBFixture.cs

#
C# | 88 lines | 44 code | 10 blank | 34 comment | 1 complexity | 9f78450e86d11379c70b6ac010ef8a5f MD5 | raw file
  1. //===============================================================================
  2. // Microsoft patterns & practices
  3. // Composite Application Guidance for Windows Presentation Foundation
  4. //===============================================================================
  5. // Copyright (c) Microsoft Corporation. All rights reserved.
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
  7. // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
  8. // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  9. // FITNESS FOR A PARTICULAR PURPOSE.
  10. //===============================================================================
  11. // The example companies, organizations, products, domain names,
  12. // e-mail addresses, logos, people, places, and events depicted
  13. // herein are fictitious. No association with any real company,
  14. // organization, product, domain name, email address, logo, person,
  15. // places, or events is intended or should be inferred.
  16. //===============================================================================
  17. using System;
  18. using Microsoft.VisualStudio.TestTools.UnitTesting;
  19. using Modularity.AcceptanceTests.TestInfrastructure;
  20. using Modularity.AcceptanceTests.ApplicationObserver;
  21. using Core.UIItems;
  22. using Core.UIItems.Finders;
  23. namespace Modularity.AcceptanceTests.AutomatedTests
  24. {
  25. /// <summary>
  26. /// Summary description for ModuleBFixture
  27. /// </summary>
  28. [TestClass]
  29. [DeploymentItem(@".\DirectoryLookupModularity\DirectoryLookupModularity\bin\Debug")]
  30. [DeploymentItem(@".\Modularity.Tests.AcceptanceTests\bin\Debug")]
  31. public class DirectoryLookupModularityModuleBFixture : DirectoryLookupModularityFixtureBase
  32. {
  33. [TestInitialize()]
  34. public void MyTestInitialize()
  35. {
  36. // Check whether any exception occured during previous application launches.
  37. // If so, fail the test case.
  38. if (StateDiagnosis.IsFailed)
  39. {
  40. Assert.Fail(TestDataInfrastructure.GetTestInputData("ApplicationLoadFailure"));
  41. }
  42. base.TestInitialize();
  43. }
  44. /// <summary>
  45. /// TestCleanup performs clean-up activities after each test method execution
  46. /// </summary>
  47. [TestCleanup()]
  48. public void MyTestCleanup()
  49. {
  50. base.TestCleanup();
  51. }
  52. /// <summary>
  53. /// Click "Load Module C" button.
  54. ///
  55. /// Repro Steps:
  56. /// 1. Launch Modularity QS application
  57. /// 2. click on "Load Module C" button
  58. ///
  59. /// Expected Result:
  60. /// On click of the button Module C content gets displayed
  61. /// </summary>
  62. [TestMethod]
  63. public void ClickLoadModuleCButton()
  64. {
  65. Button button = Window.Get<Button>(
  66. SearchCriteria
  67. .ByText(TestDataInfrastructure.GetControlId("LoadModuleCButtonText"))
  68. .AndControlType(typeof(Button)));
  69. Assert.IsNotNull(button);
  70. button.Click();
  71. Label moduleCContent = Window.Get<Label>(
  72. SearchCriteria
  73. .ByText(TestDataInfrastructure.GetTestInputData("ModuleCContent"))
  74. .AndControlType(typeof(Label)));
  75. Assert.IsNotNull(moduleCContent);
  76. }
  77. }
  78. }