Skip to content

Commit

Permalink
chore: move internal types to Internal folder (but do not use it as n…
Browse files Browse the repository at this point in the history
…amespace provider, at least not yet)
  • Loading branch information
skwasjer committed Sep 29, 2024
1 parent 2d1f44f commit 0c0e397
Show file tree
Hide file tree
Showing 65 changed files with 71 additions and 49 deletions.
5 changes: 0 additions & 5 deletions src/MockHttp.Json/DeprecationWarnings.cs

This file was deleted.

5 changes: 2 additions & 3 deletions src/MockHttp/Responses/BitRate.cs → src/MockHttp/BitRate.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Globalization;
using MockHttp.IO;

// ReSharper disable once CheckNamespace
namespace MockHttp;
Expand Down Expand Up @@ -85,7 +84,7 @@ public static BitRate OneGigabit()
/// </summary>
/// <param name="bitRate"></param>
/// <returns></returns>
public static explicit operator int (BitRate bitRate)
public static explicit operator int(BitRate bitRate)
{
return ToInt32(bitRate);
}
Expand All @@ -95,7 +94,7 @@ public static explicit operator int (BitRate bitRate)
/// </summary>
/// <param name="bitRate"></param>
/// <returns></returns>
public static explicit operator BitRate (int bitRate)
public static explicit operator BitRate(int bitRate)
{
return FromInt32(bitRate);
}
Expand Down
5 changes: 0 additions & 5 deletions src/MockHttp/DeprecationWarnings.cs

This file was deleted.

1 change: 1 addition & 0 deletions src/MockHttp/Extensions/IRespondsExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using MockHttp.Language;
using MockHttp.Language.Flow;
using MockHttp.Language.Flow.Response;
using MockHttp.Response;
using MockHttp.Responses;

namespace MockHttp;
Expand Down
2 changes: 2 additions & 0 deletions src/MockHttp/Extensions/RequestMatchingExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
using System.Linq.Expressions;
using System.Net.Http.Headers;
using System.Text;
using MockHttp.Extensions;
using MockHttp.Http;
using MockHttp.Matchers;
using MockHttp.Patterns;
using MockHttp.Request;
using static MockHttp.Http.UriExtensions;

namespace MockHttp;
Expand Down
3 changes: 2 additions & 1 deletion src/MockHttp/Extensions/ResponseBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
using System.Net;
using System.Net.Http.Headers;
using System.Text;
using MockHttp.Extensions;
using MockHttp.Http;
using MockHttp.IO;
using MockHttp.Language.Flow.Response;
using MockHttp.Language.Response;
using MockHttp.Responses;
using MockHttp.Response.Behaviors;

namespace MockHttp;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Diagnostics.CodeAnalysis;

namespace MockHttp;
namespace MockHttp.Extensions;

internal static class HttpContentExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using MockHttp.Matchers;
using MockHttp.Responses;

namespace MockHttp;
namespace MockHttp.Extensions;

internal static class HttpRequestMatcherExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace MockHttp;
namespace MockHttp.Extensions;

internal static class ListExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Specialized;

namespace MockHttp;
namespace MockHttp.Extensions;

internal static class NameValueCollectionExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace MockHttp;
namespace MockHttp.Extensions;

internal static class ReadOnlyListExtensions
{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma warning disable S4136
using System.Net;

namespace MockHttp.Responses;
namespace MockHttp.Http;

internal class EmptyContent : HttpContent
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using MockHttp.Matchers;

namespace MockHttp;
namespace MockHttp.Request;

/// <summary>
/// A builder to configure request matchers, accepting all matchers.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using MockHttp.Matchers;

namespace MockHttp;
namespace MockHttp.Request;

internal sealed class InvertRequestMatching : RequestMatching
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace MockHttp.Responses;
using MockHttp.Responses;

namespace MockHttp.Response.Behaviors;

internal sealed class HttpContentBehavior
: IResponseBehavior
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using MockHttp.Http;
using MockHttp.Responses;

namespace MockHttp.Responses;
namespace MockHttp.Response.Behaviors;

internal sealed class HttpHeaderBehavior
: IResponseBehavior
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
namespace MockHttp.Responses;
using MockHttp.Responses;

internal class NetworkLatencyBehavior
namespace MockHttp.Response.Behaviors;

internal sealed class NetworkLatencyBehavior
: IResponseBehavior
{
private readonly NetworkLatency _networkLatency;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Net;
using MockHttp.Responses;

namespace MockHttp.Responses;
namespace MockHttp.Response.Behaviors;

internal sealed class StatusCodeBehavior
: IResponseBehavior
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using System.Runtime.InteropServices;
using MockHttp.Responses;
using MockHttp.Threading;

namespace MockHttp.Responses;
namespace MockHttp.Response.Behaviors;

internal sealed class TimeoutBehavior
: IResponseBehavior
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using System.Net;
using MockHttp.IO;
using MockHttp.Responses;

namespace MockHttp.Responses;
namespace MockHttp.Response.Behaviors;

internal sealed class TransferRateBehavior : IResponseBehavior
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace MockHttp.Responses;
using MockHttp.Responses;

namespace MockHttp.Response;

internal sealed class ExceptionStrategy : IResponseStrategy
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace MockHttp.Responses;
using MockHttp.Responses;

namespace MockHttp.Response;

internal sealed class ResponseFuncStrategy : IResponseStrategy
{
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using MockHttp.Responses;
using MockHttp.Http;
using MockHttp.Responses;

namespace MockHttp.Language.Flow.Response;

Expand Down
2 changes: 2 additions & 0 deletions src/MockHttp/Language/Flow/Response/ResponseBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System.Collections.ObjectModel;
using System.Net;
using System.Net.Http.Headers;
using MockHttp.Extensions;
using MockHttp.Http;
using MockHttp.Response.Behaviors;
using MockHttp.Responses;

namespace MockHttp.Language.Flow.Response;
Expand Down
1 change: 1 addition & 0 deletions src/MockHttp/Language/Flow/SetupPhrase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.ComponentModel;
using MockHttp.Response;
using MockHttp.Responses;

namespace MockHttp.Language.Flow;
Expand Down
1 change: 1 addition & 0 deletions src/MockHttp/Matchers/AnyMatcher.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Text;
using MockHttp.Extensions;
using MockHttp.Responses;

namespace MockHttp.Matchers;
Expand Down
1 change: 1 addition & 0 deletions src/MockHttp/Matchers/PartialContentMatcher.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Text;
using MockHttp.Extensions;

namespace MockHttp.Matchers;

Expand Down
3 changes: 2 additions & 1 deletion src/MockHttp/MockHttp.csproj.DotSettings
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=extensions/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=extensions/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=internal/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
1 change: 1 addition & 0 deletions src/MockHttp/MockHttpHandler.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.ObjectModel;
using System.Net;
using System.Text;
using MockHttp.Extensions;
using MockHttp.Language;
using MockHttp.Language.Flow;
using MockHttp.Matchers;
Expand Down
1 change: 1 addition & 0 deletions src/MockHttp/RequestMatching.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.ObjectModel;
using System.ComponentModel;
using MockHttp.Matchers;
using MockHttp.Request;

namespace MockHttp;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using static MockHttp.BitRate;

namespace MockHttp.Responses;
namespace MockHttp;

public sealed class BitRateTests
{
Expand Down
2 changes: 1 addition & 1 deletion test/MockHttp.Tests/Extensions/IRespondsExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using MockHttp.Language.Flow;
using MockHttp.Responses;

namespace MockHttp.Extensions;
namespace MockHttp;

public class IRespondsExtensionsTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using System;
using System.Collections.Specialized;
using System.Collections.Specialized;
using System.Linq.Expressions;
using System.Net.Http.Headers;
using System.Text;
using System.Xml;
using MockHttp.Extensions;
using MockHttp.Http;
using MockHttp.Matchers;
using MockHttp.Responses;
using static MockHttp.Http.UriExtensions;

namespace MockHttp.Extensions;
namespace MockHttp;

public abstract class RequestMatchingExtensionsTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System.Diagnostics;
using MockHttp.IO;
using Xunit.Abstractions;

namespace MockHttp;
namespace MockHttp.IO;

public sealed class RateLimitedStreamTests : IDisposable
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Net;

namespace MockHttp.Responses;
namespace MockHttp.Http;

public class EmptyContentTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using MockHttp.Responses;
using MockHttp.Response;
using MockHttp.Responses;

namespace MockHttp;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using MockHttp.Matchers;

namespace MockHttp;
namespace MockHttp.Request;

public class AnyRequestMatchingTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Net;

namespace MockHttp;
namespace MockHttp.Request;

public sealed class InvertRequestMatchingTests : IDisposable
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Diagnostics;
using MockHttp.Responses;

namespace MockHttp.Responses;
namespace MockHttp.Response.Behaviors;

public class TimeoutBehaviorTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace MockHttp.Responses;
using MockHttp.Responses;

namespace MockHttp.Response;

public class ExceptionStrategyTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace MockHttp.Responses;
using MockHttp.Responses;

namespace MockHttp.Response;

public class ResponseFuncStrategyTests
{
Expand Down
1 change: 1 addition & 0 deletions test/MockHttp.Tests/Matchers/RequestUriMatcherTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace MockHttp.Matchers;

[Obsolete($"Replaced with {nameof(UriMatcher)}. Will be removed in next major release.")]
public class RequestUriMatcherTests
{
[Theory]
Expand Down
3 changes: 3 additions & 0 deletions test/MockHttp.Tests/MockHttp.Tests.csproj.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=extensions/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=internal/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
1 change: 1 addition & 0 deletions test/MockHttp.Tests/RequestMatchingTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using MockHttp.Matchers;
using MockHttp.Request;

namespace MockHttp;

Expand Down

0 comments on commit 0c0e397

Please sign in to comment.