Pubcache/test/Nyanlabs.Pubcache.Tests/DocumentSerializationTests.cs
2023-11-07 16:28:17 +01:00

34 lines
660 B
C#

using Nyanlabs.Pubcache.Server.Models;
namespace Nyanlabs.Pubcache.Tests;
public class DocumentSerializationTests
{
const string DOI_STR = "10.1000/699359teststring";
[Fact]
public void DoiSerializationTest()
{
// Given
string queryText = DOI_STR;
// When
DocumentQuery doc = new(queryText);
// Then
Assert.Equal(DOI_STR, doc.Doi);
}
[Fact]
public void DoiSerializationTestExplicit()
{
// Given
string queryText = $"doi:{DOI_STR}";
// When
DocumentQuery doc = new(queryText);
// Then
Assert.Equal(DOI_STR, doc.Doi);
}
}