-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add imageService3 serialisation tests
- Loading branch information
1 parent
7ba7c90
commit af11605
Showing
5 changed files
with
42 additions
and
12 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
src/IIIF/IIIF.Tests/Serialisation/ImageService3SerialiserTests.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,38 @@ | ||
using FluentAssertions; | ||
using IIIF.ImageApi.Service; | ||
using IIIF.Serialisation; | ||
using Xunit; | ||
|
||
namespace IIIF.Tests.Serialisation | ||
{ | ||
public class ImageService3SerialiserTests | ||
{ | ||
[Fact] | ||
public void WriteJson_OutputsExpected_IfNoProfileOrProfileDescription() | ||
{ | ||
// Arrange | ||
var imageService = new ImageService3 { Id = "foo" }; | ||
const string expected = "{\n \"id\": \"foo\",\n \"type\": \"ImageService3\"\n}"; | ||
|
||
// Act | ||
var result = imageService.AsJson().Replace("\r\n", "\n"); | ||
|
||
// Assert | ||
result.Should().Be(expected); | ||
} | ||
|
||
[Fact] | ||
public void WriteJson_OutputsExpected_ProfileOnly() | ||
{ | ||
// Arrange | ||
var imageService = new ImageService3 { Id = "foo", Profile = "bar" }; | ||
const string expected = "{\n \"id\": \"foo\",\n \"type\": \"ImageService3\",\n \"profile\": \"bar\"\n}"; | ||
|
||
// Act | ||
var result = imageService.AsJson().Replace("\r\n", "\n"); | ||
|
||
// Assert | ||
result.Should().Be(expected); | ||
} | ||
} | ||
} |
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
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,5 +1,4 @@ | ||
using System; | ||
using System.Linq; | ||
using IIIF.Presentation.V3; | ||
using IIIF.Utils; | ||
using Newtonsoft.Json; | ||
|