Skip to content

Commit

Permalink
Mark JsonConverters and extension methods as internal classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Viincenttt committed Mar 29, 2024
1 parent e3c9bd6 commit d94e32e
Show file tree
Hide file tree
Showing 19 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/Mollie.Api/Extensions/DateTimeExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;

namespace Mollie.Api.Extensions {
public static class DateTimeExtensions {
internal static class DateTimeExtensions {
public static DateTime Truncate(this DateTime dateTime, TimeSpan timeSpan)
{
if (timeSpan == TimeSpan.Zero) {
Expand Down
4 changes: 1 addition & 3 deletions src/Mollie.Api/Extensions/DictionaryExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("Mollie.Tests.Integration")]
namespace Mollie.Api.Extensions {
public static class DictionaryExtensions {
internal static class DictionaryExtensions {
public static string ToQueryString(this IDictionary<string, string> parameters) {
if (!parameters.Any()) {
return string.Empty;
Expand Down
3 changes: 1 addition & 2 deletions src/Mollie.Api/Extensions/HttpClientExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using System;
using System.Diagnostics;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;

namespace Mollie.Api.Extensions {
public static class HttpClientExtensions {
internal static class HttpClientExtensions {
public static Task<HttpResponseMessage> PatchAsync(this HttpClient client, string requestUri, HttpContent content) {
return client.PatchAsync(CreateUri(requestUri), content);
}
Expand Down
5 changes: 1 addition & 4 deletions src/Mollie.Api/Extensions/ListExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using System.Collections.Generic;
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("Mollie.Tests.Integration")]
namespace Mollie.Api.Extensions {
public static class ListExtensions {
internal static class ListExtensions {
public static string ToIncludeParameter(this List<string> includeList) {
return string.Join(",", includeList);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Mollie.Api.Models.Balance.Response.BalanceReport.Specific.TransactionCategories;

namespace Mollie.Api.Framework.Factories {
public class BalanceReportResponseFactory {
internal class BalanceReportResponseFactory {
public BalanceReportResponse Create(string reportGrouping) {
switch (reportGrouping) {
case ReportGrouping.StatusBalances:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Mollie.Api.Models.Balance.Response.BalanceTransaction.Specific;

namespace Mollie.Api.Framework.Factories {
public class BalanceTransactionFactory {
internal class BalanceTransactionFactory {
public BalanceTransaction Create(string type) {
switch (type) {
case BalanceTransactionContextType.Payment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Mollie.Api.Models.Payment.Response.Specific;

namespace Mollie.Api.Framework.Factories {
public class PaymentResponseFactory {
internal class PaymentResponseFactory {
public PaymentResponse Create(string paymentMethod) {
switch (paymentMethod) {
case PaymentMethod.BankTransfer:
Expand Down
2 changes: 1 addition & 1 deletion src/Mollie.Api/Framework/Idempotency/AsyncLocalVariable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Mollie.Api.Framework.Idempotency
{
public class AsyncLocalVariable<T> : IDisposable where T : class
internal class AsyncLocalVariable<T> : IDisposable where T : class
{
private readonly AsyncLocal<T> _asyncLocal = new AsyncLocal<T>();

Expand Down
3 changes: 1 addition & 2 deletions src/Mollie.Api/Framework/JsonConverterService.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using System.Collections.Generic;
using Mollie.Api.Extensions;
using Mollie.Api.Framework.Factories;
using Mollie.Api.JsonConverters;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace Mollie.Api.Framework {
public class JsonConverterService {
internal class JsonConverterService {
private readonly JsonSerializerSettings _defaultJsonDeserializerSettings;

public JsonConverterService() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Newtonsoft.Json.Linq;

namespace Mollie.Api.JsonConverters {
public class BalanceReportResponseJsonConverter : JsonCreationConverter<BalanceReportResponse> {
internal class BalanceReportResponseJsonConverter : JsonCreationConverter<BalanceReportResponse> {
private readonly BalanceReportResponseFactory _balanceReportResponseFactory;

public BalanceReportResponseJsonConverter(BalanceReportResponseFactory balanceReportResponseFactory) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using System;
using Mollie.Api.Framework.Factories;
using Mollie.Api.Models.Balance.Response.BalanceTransaction;
using Mollie.Api.Models.Balance.Response.BalanceTransaction.Specific;
using Newtonsoft.Json.Linq;

namespace Mollie.Api.JsonConverters {
public class BalanceTransactionJsonConverter : JsonCreationConverter<BalanceTransaction> {
internal class BalanceTransactionJsonConverter : JsonCreationConverter<BalanceTransaction> {
private readonly BalanceTransactionFactory _balanceTransactionFactory;

public BalanceTransactionJsonConverter(BalanceTransactionFactory balanceTransactionFactory) {
Expand Down
2 changes: 1 addition & 1 deletion src/Mollie.Api/JsonConverters/Iso8601DateTimeConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Newtonsoft.Json.Converters;

namespace Mollie.Api.JsonConverters {
public class Iso8601DateTimeConverter : IsoDateTimeConverter
internal class Iso8601DateTimeConverter : IsoDateTimeConverter
{
public Iso8601DateTimeConverter() {
DateTimeStyles = DateTimeStyles.AdjustToUniversal;
Expand Down
2 changes: 1 addition & 1 deletion src/Mollie.Api/JsonConverters/JsonCreationConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Mollie.Api.JsonConverters {
/// generating the CanConvert, ReadJson, and WriteJson methods, requiring the implementer only to define a strongly
/// typed Create method.
/// </summary>
public abstract class JsonCreationConverter<T> : JsonConverter {
internal abstract class JsonCreationConverter<T> : JsonConverter {
/// <summary>Create an instance of objectType, based properties in the JSON object</summary>
/// <param name="objectType">type of object expected</param>
/// <param name="jObject">contents of JSON object that will be deserialized</param>
Expand Down
2 changes: 1 addition & 1 deletion src/Mollie.Api/JsonConverters/ListResponseJsonConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Mollie.Api.JsonConverters {
using Newtonsoft.Json.Linq;
public class ListResponseConverter : JsonConverter {
internal class ListResponseConverter : JsonConverter {

public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) {
throw new NotImplementedException("Not implemented");
Expand Down
2 changes: 1 addition & 1 deletion src/Mollie.Api/JsonConverters/MicrosecondEpochConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Newtonsoft.Json.Converters;

namespace Mollie.Api.JsonConverters {
public class MicrosecondEpochConverter : DateTimeConverterBase
internal class MicrosecondEpochConverter : DateTimeConverterBase
{
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Mollie.Api/JsonConverters/PaymentResponseConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Newtonsoft.Json.Linq;

namespace Mollie.Api.JsonConverters {
public class PaymentResponseConverter : JsonCreationConverter<PaymentResponse> {
internal class PaymentResponseConverter : JsonCreationConverter<PaymentResponse> {
private readonly PaymentResponseFactory _paymentResponseFactory;

public PaymentResponseConverter(PaymentResponseFactory paymentResponseFactory) {
Expand Down
2 changes: 1 addition & 1 deletion src/Mollie.Api/JsonConverters/RawJsonConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Newtonsoft.Json.Linq;

namespace Mollie.Api.JsonConverters {
public class RawJsonConverter : JsonConverter {
internal class RawJsonConverter : JsonConverter {
public override bool CanConvert(Type objectType) {
return objectType == typeof(string);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Mollie.Api/JsonConverters/SettlementPeriodConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Collections.Generic;

namespace Mollie.Api.JsonConverters {
public class SettlementPeriodConverter : JsonConverter {
internal class SettlementPeriodConverter : JsonConverter {
public override bool CanConvert(Type objectType) {
return false;
}
Expand Down
8 changes: 8 additions & 0 deletions src/Mollie.Api/Mollie.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,12 @@
<None Include="..\..\LICENSE" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>Mollie.Tests.Unit</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>Mollie.Tests.Integration</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
</Project>

0 comments on commit d94e32e

Please sign in to comment.