Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
adding test Retry
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed Mar 4, 2019
1 parent 7692423 commit 9acc51b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="XunitRetry" Version="2.0.0" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>

Expand Down
10 changes: 7 additions & 3 deletions tests/Prism.Plugin.Popups.Tests.Shared/Tests/FixtureBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
using System.Reflection;
using Rg.Plugins.Popup.Services;
using Prism.Plugin.Popups.Tests.Mocks.Services;
using Prism.Navigation;

namespace Prism.Plugin.Popups.Tests.Fixtures
{
public abstract class FixtureBase
{
private ITestOutputHelper _testOutputHelper { get; }
protected ITestOutputHelper _testOutputHelper { get; }

public FixtureBase(ITestOutputHelper testOutputHelper)
{
Expand All @@ -23,7 +24,10 @@ public FixtureBase(ITestOutputHelper testOutputHelper)

}

protected AppMock GetApp() =>
new AppMock(new XUnitPlatformInitializer(_testOutputHelper));
protected AppMock GetApp()
{
PageNavigationRegistry.ClearRegistrationCache();
return new AppMock(new XUnitPlatformInitializer(_testOutputHelper));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public NavigationServiceFixture(ITestOutputHelper testOutputHelper)
{
}

[Fact]
public void PopupNavigationService_SetsStandardPages()
[Retry]
{
var app = GetApp();
Assert.Empty(PopupNavigation.Instance.PopupStack);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public RegistrationFixture(ITestOutputHelper testOutputHelper)

}

[Fact]
[Retry]
public void MockPopupNavigation_IsSet()
{
IPopupNavigation popupNavigation = null;
Expand All @@ -39,7 +39,7 @@ public void MockPopupNavigation_IsSet()
Assert.IsType<PluginNavigationMock>(popupNavigation);
}

[Fact]
[Retry]
public void CreateApp_DoesNotThrowException()
{
AppMock app = null;
Expand All @@ -50,7 +50,7 @@ public void CreateApp_DoesNotThrowException()
Assert.NotNull(app);
}

[Fact]
[Retry]
public void CreateApp_DoesNotThrowExceptionWithNoPlatformInitializer()
{
AppMock app = null;
Expand All @@ -60,15 +60,15 @@ public void CreateApp_DoesNotThrowExceptionWithNoPlatformInitializer()
Assert.NotNull(app);
}

[Fact]
[Retry]
public void Application_Has_PopupNavigationService()
{
var app = GetApp();
Assert.IsType<PopupPageNavigationService>(app.GetNavigationService());
}

[Fact]
public void MainPage_Has_PopupNavigationService()
[Retry]
{
var app = GetApp();
var vm = app.MainPage.BindingContext as MainPageViewModel;
Expand All @@ -77,7 +77,7 @@ public void MainPage_Has_PopupNavigationService()
Assert.IsType<PopupPageNavigationService>(vm.NavigationService);
}

[Fact]
[Retry]
public void Container_Resolves_PopupNavigationService()
{
var app = GetApp();
Expand All @@ -86,7 +86,7 @@ public void Container_Resolves_PopupNavigationService()
Assert.IsType<PopupPageNavigationService>(navService);
}

[Fact]
[Retry]
public void PopupPageBehaviorFactory_IsRegistered()
{
var app = GetApp();
Expand All @@ -99,7 +99,7 @@ public void PopupPageBehaviorFactory_IsRegistered()
Assert.IsType<PopupPageBehaviorFactory>(behaviorFactory);
}

[Fact]
[Retry]
public void IPopupNavigation_IsRegistered()
{
var app = GetApp();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="XunitRetry" Version="2.0.0" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>

Expand Down

0 comments on commit 9acc51b

Please sign in to comment.