Skip to content

Commit

Permalink
Create Vonage.Common project (#332)
Browse files Browse the repository at this point in the history
* Create Vonage.Common library

* Remove unused changelog

* Update readme file
  • Loading branch information
Tr00d authored Jan 17, 2023
1 parent 9933936 commit bfcc929
Show file tree
Hide file tree
Showing 138 changed files with 613 additions and 569 deletions.
103 changes: 0 additions & 103 deletions CHANGELOG.md

This file was deleted.

61 changes: 40 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,17 @@ Changes in version 6.x

## Targeted frameworks

* netstandard2.0

## Tested frameworks

* .NET Framework 4.6.2
* .NET Standard 2.0
* .NET Framework 4.7.0
* .NET Framework 4.7.1
* .NET Framework 4.7.2
* .NET Framework 4.8.0
* .NET 6.0
* .NET 6.0-Windows

## Configuration

Expand Down Expand Up @@ -431,25 +440,26 @@ Make sure to copy appsettings.json.example to appsettings.json and enter your ke

The following is a list of Vonage APIs and whether the Vonage .NET SDK provides support for them:

| API | API Release Status | Supported?
|----------|:---------:|:-------------:|
| Account API | General Availability ||
| Alerts API | General Availability ||
| Application API | General Availability ||
| Audit API | Beta ||
| Conversation API | Beta ||
| Dispatch API | Beta ||
| External Accounts API | Beta ||
| Media API | Beta ||
| Messages API | General Availability ||
| Number Insight API | General Availability ||
| Number Management API | General Availability ||
| Pricing API | General Availability ||
| Redact API | Developer Preview ||
| Reports API | Beta ||
| SMS API | General Availability ||
| Verify API | General Availability ||
| Voice API | General Availability ||
| API | API Release Status | Supported?
|-----------------------|:--------------------:|:----------:|
| Account API | General Availability ||
| Alerts API | General Availability ||
| Application API | General Availability ||
| Audit API | Beta ||
| Conversation API | Beta ||
| Dispatch API | Beta ||
| External Accounts API | Beta ||
| Media API | Beta ||
| Messages API | General Availability ||
| Number Insight API | General Availability ||
| Number Management API | General Availability ||
| Pricing API | General Availability ||
| Redact API | Developer Preview ||
| Reports API | Beta ||
| SMS API | General Availability ||
| Verify API | General Availability ||
| Video API | Beta ||
| Voice API | General Availability ||

## FAQ

Expand All @@ -459,11 +469,20 @@ A: Yes
Contributing
------------

Visual Studio 2017 is required (Community is fine). v15.5+ is recommended.
Pick your preferred IDE:

- Visual Studio (Community is fine)
- Visual Studio Code
- Jetbrains Rider

Keep in mind the SDK is built on `netstandard2.0` and tested against several framework versions (v4.6.2 & upper, and
.Net6.0).
Therefore, they should be installed on your machine to guarantee compatibility with all supported framework versions.

1. Get the latest code either by cloning the repository or downloading a snapshot of the source.
2. Open "Vonage.sln"
3. Build! NuGet dependencies should be brought down automatically; check your settings if they are not.
4. Tests! Run all the tests to verify everything's fine.

Pull requests are welcome!

Expand Down
11 changes: 11 additions & 0 deletions Vonage.Common.Test/Extensions/FluentAssertionExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Vonage.Common.Monads;

namespace Vonage.Common.Test.Extensions
{
public static class FluentAssertionExtensions
{
public static MaybeAssertionExtensions<T> Should<T>(this Maybe<T> instance) => new(instance);

public static ResultAssertionExtension<T> Should<T>(this Result<T> instance) => new(instance);
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System.Net;
using FsCheck;
using Vonage.Server.Common;

namespace Vonage.Server.Test.Extensions
namespace Vonage.Common.Test.Extensions
{
/// <summary>
/// Extensions for FsCheck.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using System;
using FluentAssertions;
using FluentAssertions;
using FluentAssertions.Execution;
using FluentAssertions.Primitives;
using Vonage.Server.Common.Monads;
using Vonage.Common.Monads;

namespace Vonage.Server.Test.Extensions
namespace Vonage.Common.Test.Extensions
{
public class MaybeAssertionExtensions<T> : ReferenceTypeAssertions<Maybe<T>, MaybeAssertionExtensions<T>>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using System;
using FluentAssertions;
using FluentAssertions;
using FluentAssertions.Execution;
using FluentAssertions.Primitives;
using Vonage.Server.Common.Failures;
using Vonage.Server.Common.Monads;
using Vonage.Common.Failures;
using Vonage.Common.Monads;

namespace Vonage.Server.Test.Extensions
namespace Vonage.Common.Test.Extensions
{
public class ResultAssertionExtension<T> : ReferenceTypeAssertions<Result<T>, ResultAssertionExtension<T>>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net;
using WireMock.RequestBuilders;
using WireMock.ResponseBuilders;

namespace Vonage.Server.Test.Extensions
namespace Vonage.Common.Test.Extensions
{
/// <summary>
/// Extensions for WireMock.Net
Expand Down Expand Up @@ -63,7 +61,7 @@ public static IResponseBuilder CreateResponse(HttpStatusCode code) =>
Response.Create().WithStatusCode(code);

private static IRequestBuilder BuildRequestWithAuthenticationHeader(string token) =>
WireMock.RequestBuilders.Request
Request
.Create()
.WithHeader("Authorization", $"Bearer {token}");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System.Net;
using Vonage.Server.Common.Failures;
using Vonage.Server.Test.Extensions;
using Xunit;
using Vonage.Common.Failures;
using Vonage.Common.Test.Extensions;

namespace Vonage.Server.Test.Common.Failures
namespace Vonage.Common.Test.Failures
{
public class HttpFailureDeserializationTest
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System.Net;
using FluentAssertions;
using Vonage.Server.Common.Failures;
using Xunit;
using Vonage.Common.Failures;

namespace Vonage.Server.Test.Common.Failures
namespace Vonage.Common.Test.Failures
{
public class HttpFailureTest
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using FluentAssertions;
using Vonage.Server.Common.Failures;
using Xunit;
using Vonage.Common.Failures;

namespace Vonage.Server.Test.Common.Failures
namespace Vonage.Common.Test.Failures
{
public class ResultFailureTest
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System;
using FluentAssertions;
using Vonage.Server.Common.Monads;
using Vonage.Server.Test.Extensions;
using Xunit;
using FluentAssertions;
using Vonage.Common.Monads;
using Vonage.Common.Test.Extensions;

namespace Vonage.Server.Test.Common.Monads
namespace Vonage.Common.Test.Monads
{
public class MaybeTest
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
using System;
using System.Threading.Tasks;
using FluentAssertions;
using Vonage.Server.Common.Failures;
using Vonage.Server.Common.Monads;
using Vonage.Server.Test.Extensions;
using Xunit;

namespace Vonage.Server.Test.Common.Monads
using FluentAssertions;
using Vonage.Common.Failures;
using Vonage.Common.Monads;
using Vonage.Common.Test.Extensions;

namespace Vonage.Common.Test.Monads
{
public class ResultTest
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using FluentAssertions;
using Vonage.Common.Serialization;

namespace Vonage.Common.Test.Serialization
{
public class EnumDescriptionJsonConverterTest
{
private readonly EnumDescriptionJsonConverter<DummyEnum> converter;

public EnumDescriptionJsonConverterTest()
{
this.converter = new EnumDescriptionJsonConverter<DummyEnum>();
}

[Fact]
public void HandleNull_ShouldReturnTrue() => this.converter.HandleNull.Should().BeTrue();

private enum DummyEnum
{
}
}
}
Loading

0 comments on commit bfcc929

Please sign in to comment.