-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Http request/response formatter public
- Loading branch information
1 parent
4afaab7
commit aeb4980
Showing
55 changed files
with
180 additions
and
122 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
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
3 changes: 2 additions & 1 deletion
3
src/FluentAssertions.Web.Serializers.NewtonsoftJson/GlobalUsings.cs
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
1 change: 1 addition & 0 deletions
1
src/FluentAssertions.Web.Serializers.NewtonsoftJson/NewtonsoftJsonSerializer.cs
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,4 +1,5 @@ | ||
// ReSharper disable once CheckNamespace | ||
|
||
namespace FluentAssertions; | ||
|
||
/// <summary> | ||
|
This file was deleted.
Oops, something went wrong.
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
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
3 changes: 1 addition & 2 deletions
3
...ns.Web.Types/FluentAssertionsWebConfig.cs → ...sertions.Web/FluentAssertionsWebConfig.cs
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
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
19 changes: 19 additions & 0 deletions
19
src/FluentAssertions.Web/Internal/HttpResponseMessageFormatter.cs
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,19 @@ | ||
using FluentAssertions.Formatting; | ||
|
||
internal class HttpResponseMessageFormatter : IValueFormatter | ||
{ | ||
public bool CanHandle(object value) => value is HttpResponseMessage; | ||
|
||
/// <inheritdoc /> | ||
public void Format(object value, | ||
FormattedObjectGraph formattedGraph, | ||
FormattingContext context, | ||
FormatChild formatChild) | ||
{ | ||
var response = (HttpResponseMessage)value; | ||
|
||
var formatted = HttpResponseMessageFormatted.GetFormatted(response); | ||
|
||
formattedGraph.AddFragment(formatted); | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...rtions.Web/Internal/AssertionsFailures.cs → src/Ited.HttpFormatter/AssertionsFailures.cs
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,19 @@ | ||
using System.Text; | ||
|
||
namespace Ited.HttpFormatter; | ||
|
||
public class AssertionsFailuresFormatted | ||
{ | ||
public static string GetFormatted(AssertionsFailures assertionsFailures) | ||
{ | ||
var messageBuilder = new StringBuilder(); | ||
messageBuilder.AppendLine(); | ||
messageBuilder.AppendLine(); | ||
|
||
foreach (var failure in assertionsFailures.FailuresMessages) | ||
{ | ||
messageBuilder.AppendLine($" - {failure.ReplaceFirstWithLowercase()}"); | ||
} | ||
return messageBuilder.ToString(); | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...s.Web/Internal/ContentFormatterOptions.cs → ....HttpFormatter/ContentFormatterOptions.cs
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
3 changes: 1 addition & 2 deletions
3
...ons.Web.Types/DeserializationException.cs → ...HttpFormatter/DeserializationException.cs
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,10 @@ | ||
global using Ited.HttpFormatter.Internal; | ||
global using Ited.HttpFormatter; | ||
global using System; | ||
global using System.Collections.Generic; | ||
global using System.IO; | ||
global using System.Linq; | ||
global using System.Net; | ||
global using System.Net.Http; | ||
global using System.Text.Json; | ||
global using System.Threading.Tasks; |
4 changes: 2 additions & 2 deletions
4
src/FluentAssertions.Web/Internal/Guard.cs → src/Ited.HttpFormatter/Guard.cs
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
4 changes: 2 additions & 2 deletions
4
...Internal/HttpResponseMessageExtensions.cs → ...ormatter/HttpResponseMessageExtensions.cs
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
7 changes: 1 addition & 6 deletions
7
...FluentAssertions.Web.Types/ISerializer.cs → src/Ited.HttpFormatter/ISerializer.cs
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
2 changes: 1 addition & 1 deletion
2
...eb/Internal/ContentProcessors/Appender.cs → ...er/Internal/ContentProcessors/Appender.cs
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
2 changes: 1 addition & 1 deletion
2
...rnal/ContentProcessors/BinaryProcessor.cs → ...rnal/ContentProcessors/BinaryProcessor.cs
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
2 changes: 1 addition & 1 deletion
2
...al/ContentProcessors/IContentProcessor.cs → ...al/ContentProcessors/IContentProcessor.cs
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
2 changes: 1 addition & 1 deletion
2
...rocessors/InternalServerErrorProcessor.cs → ...rocessors/InternalServerErrorProcessor.cs
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
2 changes: 1 addition & 1 deletion
2
...l/ContentProcessors/MultipartProcessor.cs → ...l/ContentProcessors/MultipartProcessor.cs
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
2 changes: 1 addition & 1 deletion
2
...ternal/ContentProcessors/ProcessorBase.cs → ...ternal/ContentProcessors/ProcessorBase.cs
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.