This repository has been archived by the owner on Apr 14, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
215 additions
and
39 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Apphbify.Data; | ||
using Xunit; | ||
|
||
namespace Apphbify.Tests.Bootstrapper | ||
{ | ||
public class DoesRegionExist | ||
{ | ||
[Fact] | ||
public void It_should_return_true_when_region_exists() | ||
{ | ||
Assert.True(new DataStore().DoesRegionExist("amazon-web-services::us-east-1")); | ||
} | ||
|
||
[Fact] | ||
public void It_should_return_false_when_region_does_not_exist() | ||
{ | ||
Assert.False(new DataStore().DoesRegionExist("foo")); | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Collections.Generic; | ||
using Apphbify.Data; | ||
using Xunit; | ||
|
||
namespace Apphbify.Tests.DataStoreTests | ||
{ | ||
public class GetAllRegions | ||
{ | ||
IList<Region> _Regions; | ||
|
||
public GetAllRegions() | ||
{ | ||
_Regions = new DataStore().GetAllRegions(); | ||
} | ||
|
||
[Fact] | ||
public void It_should_load_some_regions() | ||
{ | ||
Assert.NotEqual(0, _Regions.Count); | ||
} | ||
} | ||
} |
This file contains 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
37 changes: 37 additions & 0 deletions
37
Apphbify.Tests/Pages/Deploy/When_an_invalid_region_id_is_specified.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Apphbify.Tests.Helpers; | ||
using Nancy.Testing; | ||
using Xunit; | ||
|
||
namespace Apphbify.Tests.Pages.Deploy | ||
{ | ||
public class When_an_invalid_region_id_is_specified | ||
{ | ||
private Browser _Browser; | ||
private BrowserResponse _Response; | ||
|
||
public When_an_invalid_region_id_is_specified() | ||
{ | ||
_Browser = Testing.CreateBrowser<SecuredPagesModule>(with => | ||
{ | ||
with.LoggedInUser(); | ||
}); | ||
_Response = _Browser.Post("/Deploy/jabbr", with => | ||
{ | ||
with.FormValue("application_name", "foo"); | ||
with.FormValue("region_id", "foo"); | ||
}); | ||
} | ||
|
||
[Fact] | ||
public void It_should_redirect_to_get() | ||
{ | ||
_Response.ShouldHaveRedirectedTo("/Deploy/jabbr"); | ||
} | ||
|
||
[Fact] | ||
public void It_should_include_an_error() | ||
{ | ||
_Response.ShouldHaveErrorMessage(); | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
36 changes: 36 additions & 0 deletions
36
Apphbify.Tests/Pages/Deploy/When_no_region_id_is_specified.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using Apphbify.Tests.Helpers; | ||
using Nancy.Testing; | ||
using Xunit; | ||
|
||
namespace Apphbify.Tests.Pages.Deploy | ||
{ | ||
public class When_no_region_id_is_specified | ||
{ | ||
private Browser _Browser; | ||
private BrowserResponse _Response; | ||
|
||
public When_no_region_id_is_specified() | ||
{ | ||
_Browser = Testing.CreateBrowser<SecuredPagesModule>(with => | ||
{ | ||
with.LoggedInUser(); | ||
}); | ||
_Response = _Browser.Post("/Deploy/jabbr", with => | ||
{ | ||
with.FormValue("application_name", "foo"); | ||
}); | ||
} | ||
|
||
[Fact] | ||
public void It_should_redirect_to_get() | ||
{ | ||
_Response.ShouldHaveRedirectedTo("/Deploy/jabbr"); | ||
} | ||
|
||
[Fact] | ||
public void It_should_include_an_error() | ||
{ | ||
_Response.ShouldHaveErrorMessage(); | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.