PageRenderTime 22ms CodeModel.GetById 12ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 1ms

/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
18using System;
19using Microsoft.VisualStudio.TestTools.UnitTesting;
20using Modularity.AcceptanceTests.TestInfrastructure;
21using Modularity.AcceptanceTests.ApplicationObserver;
22using Core.UIItems;
23using Core.UIItems.Finders;
24
25namespace Modularity.AcceptanceTests.AutomatedTests
26{
27    /// <summary>
28    /// Summary description for ModuleBFixture
29    /// </summary>
30    [TestClass]
31    [DeploymentItem(@".\DirectoryLookupModularity\DirectoryLookupModularity\bin\Debug")]
32    [DeploymentItem(@".\Modularity.Tests.AcceptanceTests\bin\Debug")]
33    public class DirectoryLookupModularityModuleBFixture : DirectoryLookupModularityFixtureBase
34    {
35        [TestInitialize()]
36        public void MyTestInitialize()
37        {
38            // Check whether any exception occured during previous application launches. 
39            // If so, fail the test case.
40            if (StateDiagnosis.IsFailed)
41            {
42                Assert.Fail(TestDataInfrastructure.GetTestInputData("ApplicationLoadFailure"));
43            }
44
45            base.TestInitialize();
46        }
47
48        /// <summary>
49        /// TestCleanup performs clean-up activities after each test method execution
50        /// </summary>
51        [TestCleanup()]
52        public void MyTestCleanup()
53        {
54            base.TestCleanup();
55        }
56
57        /// <summary>
58        /// Click "Load Module C" button.
59        /// 
60        /// Repro Steps:
61        /// 1. Launch Modularity QS application
62        /// 2. click on "Load Module C" button
63        /// 
64        /// Expected Result:
65        /// On click of the button Module C content gets displayed
66        /// </summary>
67        [TestMethod]
68        public void ClickLoadModuleCButton()
69        {
70            Button button = Window.Get<Button>(
71                SearchCriteria
72                    .ByText(TestDataInfrastructure.GetControlId("LoadModuleCButtonText"))
73                    .AndControlType(typeof(Button)));
74            
75            Assert.IsNotNull(button);
76
77            button.Click();
78
79            Label moduleCContent = Window.Get<Label>(
80                SearchCriteria
81                    .ByText(TestDataInfrastructure.GetTestInputData("ModuleCContent"))
82                    .AndControlType(typeof(Label)));
83
84            Assert.IsNotNull(moduleCContent);
85        }
86    }
87}
88