Skip to content

Commit 9deaaa6

Browse files
authored
Add JSON serialisation placeholder unit test. (#429)
1 parent fc32bcf commit 9deaaa6

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
//-----------------------------------------------------------------------------
2+
// Filename: PayoutSerialisationTests.cs
3+
//
4+
// Description: Unit tests for serialising a Payout model to JSON.
5+
//
6+
// Author(s):
7+
// Aaron Clauson ([email protected])
8+
//
9+
// History:
10+
// 10 Oct 2024 Aaron Clauson Created, Stillorgan Wood, Dublin, Ireland.
11+
//
12+
// License:
13+
// MIT.
14+
//-----------------------------------------------------------------------------
15+
16+
using Microsoft.Extensions.Logging;
17+
using NoFrixion.MoneyMoov.Models;
18+
using System.Text;
19+
using Xunit;
20+
using Xunit.Abstractions;
21+
22+
namespace NoFrixion.MoneyMoov.UnitTests.Json;
23+
24+
public class PayoutSerialisationTests : MoneyMoovUnitTestBase<PayoutSerialisationTests>
25+
{
26+
public PayoutSerialisationTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper)
27+
{ }
28+
29+
[Fact]
30+
public async Task Serialize_Payout_Success()
31+
{
32+
Logger.LogDebug($"--> {TypeExtensions.GetCaller()}.");
33+
34+
var payout = new Payout
35+
{
36+
Amount = 42.42m,
37+
Currency = CurrencyTypeEnum.EUR,
38+
TheirReference = "123 456",
39+
Status = PayoutStatus.PROCESSED
40+
};
41+
42+
var json = payout.ToJsonFlat();
43+
var content = new StringContent(json, Encoding.UTF8, "application/json");
44+
45+
Logger.LogDebug($"json: {json}");
46+
Logger.LogDebug($"content: {await content.ReadAsStringAsync()}");
47+
}
48+
}

0 commit comments

Comments
 (0)