Skip to content

Commit

Permalink
Merge pull request #8 from amadeus4dev/integration-tests
Browse files Browse the repository at this point in the history
First stable version of the Amadeus for Developers Dotnet SDK
torresc24 authored Dec 16, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 3a42602 + e8c1f2e commit 4f3db74
Showing 16 changed files with 340 additions and 28 deletions.
74 changes: 74 additions & 0 deletions .github/CODE_OF_CONDUCT.md
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

82 changes: 82 additions & 0 deletions .github/CONTRIBUTING.md
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).
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE.md
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?
12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
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
3 changes: 3 additions & 0 deletions .github/SUPPORT.md
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](#).
1 change: 1 addition & 0 deletions .github/images/dependencies.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .github/images/support.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

11 changes: 3 additions & 8 deletions README.md
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
31 changes: 24 additions & 7 deletions amadeus-csharp.sln
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
# Visual Studio Version 17
VisualStudioVersion = 17.0.31919.166
MinimumVisualStudioVersion = 15.0.26124.0
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "amadeus", "amadeus\amadeus.csproj", "{09912E64-48D0-4F16-9FCF-EBA520592BBA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "amadeus", "amadeus\amadeus.csproj", "{09912E64-48D0-4F16-9FCF-EBA520592BBA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "amadeus-test", "amadeus-test\amadeus-test.csproj", "{7D111631-5904-4C7C-A1E4-03B1E9558880}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sample", "sample\sample.csproj", "{D6E96E62-2ECB-4B57-8859-F4AD731D9657}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "sample", "sample\sample.csproj", "{D6E96E62-2ECB-4B57-8859-F4AD731D9657}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{85623C07-D863-4656-A8D2-D235513A1B67}"
ProjectSection(SolutionItems) = preProject
.travis.yml = .travis.yml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "amadeus-integration-test", "amadeus-integration-test\amadeus-integration-test.csproj", "{923C0D46-BA02-48CE-8598-31D9AC205D9D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -23,9 +25,6 @@ Global
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{09912E64-48D0-4F16-9FCF-EBA520592BBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09912E64-48D0-4F16-9FCF-EBA520592BBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
@@ -63,5 +62,23 @@ Global
{D6E96E62-2ECB-4B57-8859-F4AD731D9657}.Release|x64.Build.0 = Release|Any CPU
{D6E96E62-2ECB-4B57-8859-F4AD731D9657}.Release|x86.ActiveCfg = Release|Any CPU
{D6E96E62-2ECB-4B57-8859-F4AD731D9657}.Release|x86.Build.0 = Release|Any CPU
{923C0D46-BA02-48CE-8598-31D9AC205D9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{923C0D46-BA02-48CE-8598-31D9AC205D9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{923C0D46-BA02-48CE-8598-31D9AC205D9D}.Debug|x64.ActiveCfg = Debug|Any CPU
{923C0D46-BA02-48CE-8598-31D9AC205D9D}.Debug|x64.Build.0 = Debug|Any CPU
{923C0D46-BA02-48CE-8598-31D9AC205D9D}.Debug|x86.ActiveCfg = Debug|Any CPU
{923C0D46-BA02-48CE-8598-31D9AC205D9D}.Debug|x86.Build.0 = Debug|Any CPU
{923C0D46-BA02-48CE-8598-31D9AC205D9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{923C0D46-BA02-48CE-8598-31D9AC205D9D}.Release|Any CPU.Build.0 = Release|Any CPU
{923C0D46-BA02-48CE-8598-31D9AC205D9D}.Release|x64.ActiveCfg = Release|Any CPU
{923C0D46-BA02-48CE-8598-31D9AC205D9D}.Release|x64.Build.0 = Release|Any CPU
{923C0D46-BA02-48CE-8598-31D9AC205D9D}.Release|x86.ActiveCfg = Release|Any CPU
{923C0D46-BA02-48CE-8598-31D9AC205D9D}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F60A6870-77DD-4B67-BBAD-45A0A50F9480}
EndGlobalSection
EndGlobal
42 changes: 42 additions & 0 deletions amadeus-integration-test/ReferenceDataTest.cs
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"));
}
}
}
17 changes: 17 additions & 0 deletions amadeus-integration-test/TestUtil.cs
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();
}
}
}
29 changes: 29 additions & 0 deletions amadeus-integration-test/amadeus-integration-test.csproj
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>
2 changes: 1 addition & 1 deletion amadeus-test/AmadeusTest.cs
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ public void TestBuilderWithEnvironment()
[Test()]
public void TestVersion()
{
Assert.IsTrue(Amadeus.VERSION == "3.0.0", "should have a version number");
Assert.IsTrue(Amadeus.VERSION == "1.0.0", "should have a version number");
}
}
}
Loading

0 comments on commit 4f3db74

Please sign in to comment.