Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Allow support for screen types with extremely long full type names #236

Merged
merged 1 commit into from
Mar 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/TestStack.White.ScreenObjects/ScreenRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private void ClearClosedScreens()

private static InitializeOption IdentifiedOption<T>(InitializeOption option)
{
return option.AndIdentifiedBy(typeof (T).FullName);
return option.AndIdentifiedBy(typeof (T).GUID.ToString());
}

private T GetScreen<T>(Window window) where T : AppScreen
Expand Down
41 changes: 41 additions & 0 deletions src/TestStack.White.UITests/GenericScreenTypeTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System.Collections.Generic;
using TestStack.White.Factory;
using TestStack.White.ScreenObjects;
using TestStack.White.UIItems;
using TestStack.White.UIItems.Finders;
using TestStack.White.UIItems.WindowItems;

namespace TestStack.White.UITests
{
public class GenericScreenTypeTest : WhiteTestBase
{
protected override void ExecuteTestRun(WindowsFramework framework)
{
var screen = Repository.Get<SomeGenericScreen<int, int>>(MainWindow.Title, InitializeOption.NoCache);
screen.MakeWindowItemsMapDirty();
Application.ApplicationSession.Save();
}

protected override IEnumerable<WindowsFramework> SupportedFrameworks()
{
yield return WindowsFramework.WinForms;
yield return WindowsFramework.Wpf;
}

private class SomeGenericScreen<T1, T2> : AppScreen
{
private readonly Window window;

public SomeGenericScreen(Window window, ScreenRepository screenRepository)
: base(window, screenRepository)
{
this.window = window;
}

public virtual void MakeWindowItemsMapDirty()
{
window.Get(SearchCriteria.All);
}
}
}
}
1 change: 1 addition & 0 deletions src/TestStack.White.UITests/TestStack.White.UITests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
<Compile Include="ControlTests\ProgressBarTest.cs" />
<Compile Include="ControlTests\WindowStripControls\StatusBarTest.cs" />
<Compile Include="ControlTests\WindowStripControls\StatusStripTest.cs" />
<Compile Include="GenericScreenTypeTest.cs" />
<Compile Include="Reporting\One.cs" />
<Compile Include="Reporting\SessionReportTest.cs" />
<Compile Include="Reporting\SubFlowsTest.cs" />
Expand Down