-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from amadeus4dev/integration-tests
First stable version of the Amadeus for Developers Dotnet SDK
Showing
16 changed files
with
340 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as | ||
contributors and maintainers pledge to making participation in our project and | ||
our community a harassment-free experience for everyone, regardless of age, body | ||
size, disability, ethnicity, gender identity and expression, level of experience, | ||
nationality, personal appearance, race, religion, or sexual identity and | ||
orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment | ||
include: | ||
|
||
* Using welcoming and inclusive language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery and unwelcome sexual attention or | ||
advances | ||
* Trolling, insulting/derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or electronic | ||
address, without explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable | ||
behavior and are expected to take appropriate and fair corrective action in | ||
response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or | ||
reject comments, commits, code, wiki edits, issues, and other contributions | ||
that are not aligned to this Code of Conduct, or to ban temporarily or | ||
permanently any contributor for other behaviors that they deem inappropriate, | ||
threatening, offensive, or harmful. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies both within project spaces and in public spaces | ||
when an individual is representing the project or its community. Examples of | ||
representing a project or community include using an official project e-mail | ||
address, posting via an official social media account, or acting as an appointed | ||
representative at an online or offline event. Representation of a project may be | ||
further defined and clarified by project maintainers. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported by contacting the project team at [email protected]. All | ||
complaints will be reviewed and investigated and will result in a response that | ||
is deemed necessary and appropriate to the circumstances. The project team is | ||
obligated to maintain confidentiality with regard to the reporter of an incident. | ||
Further details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good | ||
faith may face temporary or permanent repercussions as determined by other | ||
members of the project's leadership. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, | ||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html | ||
|
||
[homepage]: https://www.contributor-covenant.org | ||
|
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,82 @@ | ||
## Development and Testing | ||
|
||
To run the project locally, clone the repository. | ||
|
||
``` | ||
git clone https://github.com/amadeus4dev/amadeus-dotnet.git | ||
cd amadeus-java | ||
``` | ||
Download and install visual studio. | ||
|
||
Install workloads dependencies. | ||
|
||
``` | ||
.NET desktop development | ||
Universal Windows Platform development | ||
``` | ||
|
||
Open project/solution | ||
|
||
Install Other dependencies. | ||
|
||
``` | ||
xunit (Project: amadeus-integration-test) | ||
xunit.runner.visualstudio (Project: amadeus-integration-test) | ||
coverlet.collector (Project: amadeus-integration-test) | ||
Microsoft.AspNetCore.TestHost (Project: amadeus-integration-test) | ||
Microsoft.NET.Test.Sdk (Project: amadeus-integration-test) | ||
System.Runtime.CompilerServices.Unsafe (Project: amadeus-test) | ||
System.Threading.Tasks.Extensions (Project: amadeus-test) | ||
NunitTestAdapter (Project: amadeus-test) | ||
Nunit (Project: amadeus-test) | ||
Castle.Core (Project: amadeus-test) | ||
Moq (Project: amadeus-test) | ||
``` | ||
|
||
### Running tests | ||
|
||
Open Test Explorer. | ||
|
||
Click Run All Tests option. | ||
|
||
|
||
### Building | ||
|
||
Open Solution Explorer right click on the project Amadeus and select build. | ||
|
||
### Releasing | ||
|
||
To make a new release, follow the following steps: | ||
|
||
- [ ] Update the `CHANGELOG.md` with the new version | ||
- [ ] Tag your release in git using `git --tag vX.X.X` | ||
- [ ] Push the new tag `git push --tags` | ||
- [ ] Update the [Releases](https://github.com/amadeus4dev/amadeus-dotnet/releases) tab on GitHub with a new release for the tag, copying the description from the `CHANGELOG.md` | ||
|
||
## How to contribute to the Amadeus Dotnet SDK | ||
|
||
#### **Did you find a bug?** | ||
|
||
* **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/amadeus4dev/amadeus-dotnet/issues). | ||
|
||
* If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/amadeus4dev/amadeus-dotnet/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring. | ||
|
||
#### **Did you write a patch that fixes a bug?** | ||
|
||
* Open a new GitHub pull request with the patch. | ||
|
||
* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable. | ||
|
||
#### **Do you intend to add a new feature or change an existing one?** | ||
|
||
* Suggest your change [in a new issue](https://github.com/amadeus4dev/amadeus-dotnet/issues/new) and start writing code. | ||
|
||
* Make sure your new code does not break any tests and include new tests. | ||
|
||
* With good code comes good documentation. Try to copy the existing documentation and adapt it to your needs. | ||
|
||
* Close the issue or mark it as inactive if you decide to discontinue working on the code. | ||
|
||
#### **Do you have questions about the source code?** | ||
|
||
* Ask any question about how to use the library by [raising a new issue](https://github.com/amadeus4dev/amadeus-dotnet/issues/new). |
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,26 @@ | ||
## Description | ||
|
||
[Describe the issue] | ||
|
||
## Steps to Reproduce | ||
|
||
1. [First step] | ||
2. [Second step] | ||
3. [and so on...] | ||
|
||
__Expected Behavior:__ [What you expect to happen] | ||
|
||
__Actual Behavior:__ [What actually happens] | ||
|
||
__Stable Behavior?__ [What percentage of the time does it reproduce?] | ||
|
||
## Versions | ||
|
||
What version of .dotnet framework are you running? What Operating System are you on? | ||
|
||
## Checklist | ||
|
||
Please make sure you checked the following: | ||
|
||
* Which version of .dotnet framework are you using? | ||
* Did you download the latest version of this package? |
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,12 @@ | ||
Fixes # | ||
|
||
## Changes for this pull request | ||
|
||
## Checklist | ||
|
||
Remove this if you have done all of these: | ||
|
||
* Ensure all tests pass | ||
* Add any changes to the README | ||
* Add any changes or new comments to SDK methods | ||
* Ensure this PR only changes what it is intended to change |
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,3 @@ | ||
# Amadeus Support | ||
|
||
Our [developer support team](https://developer.amadeus.com/developers) is here to help you. You can find us on [Twitter](#), [StackOverflow](#), and [email](#). |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,15 +1,11 @@ | ||
| :warning: WARNING: **This SDK is still Work in Progress**: Be very careful here | | ||
| --- | | ||
# Amadeus Dotnet SDK | ||
|
||
# Amadeus C# SDK | ||
|
||
[![Build Status](https://travis-ci.org/amadeus4dev/amadeus-csharp.svg?branch=master)][travis] | ||
[![Contact Support](https://github.com/amadeus4dev/amadeus-csharp/raw/master/.github/images/support.svg?sanitize=true)][support] | ||
[![Contact Support](https://github.com/amadeus4dev/amadeus-dotnet/raw/master/.github/images/support.svg?sanitize=true)][support] | ||
|
||
Amadeus provides a set of APIs for the travel industry. Flights, Hotels, Locations and more. | ||
|
||
For more details see the [C# | ||
documentation](https://amadeus4dev.github.io/amadeus-csharp/) on | ||
documentation](https://amadeus4dev.github.io/amadeus-dotnet/) on | ||
[Amadeus.com](https://developers.amadeus.com). | ||
|
||
## Installation | ||
|
@@ -307,5 +303,4 @@ to help you. You can find us on | |
[StackOverflow](https://stackoverflow.com/questions/tagged/amadeus) and | ||
[email](mailto:[email protected]). | ||
|
||
[travis]: http://travis-ci.org/amadeus4dev/amadeus-csharp | ||
[support]: http://developers.amadeus.com/support |
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,42 @@ | ||
using amadeus; | ||
using amadeus.resources; | ||
using Xunit; | ||
using static amadeus_integration_test.TestUtil; | ||
|
||
namespace amadeus_integration_test | ||
{ | ||
public class ReferenceDataTest | ||
{ | ||
[Fact] | ||
public void Get_Checkin_Links() | ||
{ | ||
var amadeus = GetAmadeusBuild(); | ||
CheckinLink[] checkinLinksList = amadeus.referenceData.urls.checkinLinks.get(Params | ||
.with("airlineCode", "BA")); | ||
|
||
Assert.All(checkinLinksList, item => Assert.Contains(item.type, "checkin-link")); | ||
Assert.All(checkinLinksList, item => Assert.Contains("BA", item.id)); | ||
} | ||
|
||
[Fact] | ||
public void Get_Locations() | ||
{ | ||
var amadeus = GetAmadeusBuild(); | ||
Location[] locations = amadeus.referenceData.locations.get(Params | ||
.with("keyword", "LON") | ||
.and("subType", resources.referenceData.Locations.ANY)); | ||
|
||
Assert.All(locations, item => Assert.Contains(item.type, "location")); | ||
} | ||
|
||
[Fact] | ||
public void Get_Airlines() | ||
{ | ||
var amadeus = GetAmadeusBuild(); | ||
Airline[] airlines = amadeus.referenceData.airlines.get(Params | ||
.with("airlineCodes", "BA")); | ||
|
||
Assert.All(airlines, item => Assert.Contains(item.type, "airline")); | ||
} | ||
} | ||
} |
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,17 @@ | ||
using amadeus; | ||
|
||
namespace amadeus_integration_test | ||
{ | ||
public static class TestUtil | ||
{ | ||
private static readonly string API_KEY = "FGsfeaT5TPuEyVlKhY8O0OrVGpDCqK40"; | ||
private static readonly string API_SECRET = "K2riEqWxiodl9XcQ"; | ||
|
||
public static Amadeus GetAmadeusBuild() | ||
{ | ||
Configuration amadeusconfig = Amadeus.builder(API_KEY, API_SECRET); | ||
amadeusconfig.setLoglevel("debug"); | ||
return amadeusconfig.build(); | ||
} | ||
} | ||
} |
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,29 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp2.1</TargetFramework> | ||
<RootNamespace>amadeus_integration_test</RootNamespace> | ||
|
||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.1.0" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> | ||
<PackageReference Include="xunit" Version="2.4.1" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
<PackageReference Include="coverlet.collector" Version="3.1.0"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\amadeus\amadeus.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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.