This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestClass] | |
public class OnlineStorePurchase_PurchaseStrategy_Tests | |
{ | |
[TestInitialize] | |
public void SetupTest() | |
{ | |
Driver.StartBrowser(); | |
} | |
[TestCleanup] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestClass] | |
public class UnityWikipediaTests | |
{ | |
[TestInitialize] | |
public void SetupTest() | |
{ | |
Driver.StartBrowser(); | |
} | |
[TestCleanup] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class BasePageSingletonDerived<S, M> : ThreadSafeNestedContructorsBaseSingleton<S> | |
where M : BasePageElementMap, new() | |
where S : BasePageSingletonDerived<S, M> | |
{ | |
protected M Map | |
{ | |
get | |
{ | |
return new M(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BasePage<M> | |
where M : BasePageElementMap, new() | |
{ | |
protected readonly string url; | |
public BasePage(string url) | |
{ | |
this.url = url; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WikipediaMainPage : BasePage<WikipediaMainPageMap, WikipediaMainPageValidator>, IWikipediaMainPage | |
{ | |
public WikipediaMainPage() | |
: base(@"mySiteUrl") | |
{ | |
} | |
public void Search(string textToType) | |
{ | |
this.Map.SearchBox.Clear(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IWikipediaMainPage | |
{ | |
void Navigate(string part = ""); | |
WikipediaMainPageValidator Validate(); | |
void Search(string textToType); | |
void ToggleContents(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestClass] | |
public class UnityWikipediaTests | |
{ | |
private static IUnityContainer pageFactory = new UnityContainer(); | |
[AssemblyInitialize()] | |
public static void MyTestInitialize(TestContext testContext) | |
{ | |
pageFactory.RegisterType<IWikipediaMainPage, WikipediaMainPage>(new ContainerControlledLifetimeManager()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pageFactory.RegisterType<IWikipediaMainPage, WikipediaMainPage>(new ContainerControlledLifetimeManager()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration> | |
<configSections> | |
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration"/> | |
</configSections> | |
<unity xmlns="http://schemas.microsoft.com/practices/2010/unity"> | |
<container> | |
<register type="PatternsInAutomation.Tests.Advanced.Unity.WikipediaMainPage.IWikipediaMainPage, PatternsInAutomation.Tests" | |
mapTo="PatternsInAutomation.Tests.Advanced.Unity.WikipediaMainPage.WikipediaMainPage, PatternsInAutomation.Tests"> | |
<lifetime type="singleton"/> | |
</register> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<lifetime type="singleton"/> |