generated from arcus-azure/arcus.github.template
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use serilog scalar value when serializing string values (#262)
* bug: use serilog scalar value when serializing string values * pr-del: remove comment-out code
- Loading branch information
1 parent
e315bac
commit af6f4bd
Showing
4 changed files
with
135 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Arcus.Observability.Tests.Unit.Fixture | ||
{ | ||
public class Order | ||
{ | ||
[JsonPropertyName("id")] | ||
public string Id { get; set; } | ||
|
||
[JsonPropertyName("orderNumber")] | ||
public int OrderNumber { get; set; } | ||
|
||
[JsonPropertyName("scheduled")] | ||
public DateTimeOffset Scheduled { get; set; } | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Arcus.Observability.Tests.Unit/Fixture/OrderGenerator.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,22 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Bogus; | ||
using Moq; | ||
|
||
namespace Arcus.Observability.Tests.Unit.Fixture | ||
{ | ||
public static class OrderGenerator | ||
{ | ||
public static Order Generate() | ||
{ | ||
Order order = new Faker<Order>() | ||
.RuleFor(model => model.Id, bogus => bogus.Random.Guid().ToString()) | ||
.RuleFor(model => model.OrderNumber, bogus => bogus.Random.Int()) | ||
.RuleFor(model => model.Scheduled, bogus => bogus.Date.RecentOffset()) | ||
.Generate(); | ||
|
||
return order; | ||
} | ||
} | ||
} |
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