-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lint the interaction model is valid JSON.
- Loading branch information
1 parent
61af0f9
commit eae67aa
Showing
2 changed files
with
32 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) Martin Costello, 2017. All rights reserved. | ||
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. | ||
|
||
using System.Text.Json; | ||
|
||
namespace MartinCostello.LondonTravel.Skill; | ||
|
||
public static class InteractionModelTests | ||
{ | ||
[Fact] | ||
public static async Task Interaction_Model_Is_Valid_Json() | ||
{ | ||
// Arrange | ||
var type = typeof(InteractionModelTests); | ||
var assembly = type.Assembly; | ||
|
||
using var model = assembly.GetManifestResourceStream(type.Namespace + ".interaction-model.json")!; | ||
using var stream = new MemoryStream(); | ||
|
||
await model.CopyToAsync(stream); | ||
model.Seek(0, SeekOrigin.Begin); | ||
|
||
var reader = new Utf8JsonReader(stream.ToArray()); | ||
|
||
// Act | ||
bool actual = JsonDocument.TryParseValue(ref reader, out _); | ||
|
||
// Assert | ||
actual.ShouldBeTrue(); | ||
} | ||
} |
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