|
|
@ -13,49 +13,54 @@ public class CustomFormatParserTest
|
|
|
|
[Test, AutoMockData]
|
|
|
|
[Test, AutoMockData]
|
|
|
|
public void Deserialize_works(CustomFormatParser sut)
|
|
|
|
public void Deserialize_works(CustomFormatParser sut)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var jsonData = @"
|
|
|
|
const string jsonData =
|
|
|
|
{
|
|
|
|
"""
|
|
|
|
'trash_id': '90cedc1fea7ea5d11298bebd3d1d3223',
|
|
|
|
{
|
|
|
|
'trash_score': '-10000',
|
|
|
|
"trash_id": "90cedc1fea7ea5d11298bebd3d1d3223",
|
|
|
|
'name': 'EVO (no WEBDL)',
|
|
|
|
"trash_scores": {
|
|
|
|
'includeCustomFormatWhenRenaming': false,
|
|
|
|
"default": -10000,
|
|
|
|
'specifications': [
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "EVO (no WEBDL)",
|
|
|
|
'name': 'EVO',
|
|
|
|
"includeCustomFormatWhenRenaming": false,
|
|
|
|
'implementation': 'ReleaseTitleSpecification',
|
|
|
|
"specifications": [
|
|
|
|
'negate': false,
|
|
|
|
{
|
|
|
|
'required': true,
|
|
|
|
"name": "EVO",
|
|
|
|
'fields': [{
|
|
|
|
"implementation": "ReleaseTitleSpecification",
|
|
|
|
'value': '\\bEVO(TGX)?\\b'
|
|
|
|
"negate": false,
|
|
|
|
}]
|
|
|
|
"required": true,
|
|
|
|
},
|
|
|
|
"fields": [{
|
|
|
|
{
|
|
|
|
"value": "\\bEVO(TGX)?\\b"
|
|
|
|
'name': 'WEBDL',
|
|
|
|
}]
|
|
|
|
'implementation': 'SourceSpecification',
|
|
|
|
},
|
|
|
|
'negate': true,
|
|
|
|
{
|
|
|
|
'required': true,
|
|
|
|
"name": "WEBDL",
|
|
|
|
'fields': {
|
|
|
|
"implementation": "SourceSpecification",
|
|
|
|
'value': 7
|
|
|
|
"negate": true,
|
|
|
|
}
|
|
|
|
"required": true,
|
|
|
|
},
|
|
|
|
"fields": {
|
|
|
|
{
|
|
|
|
"value": 7
|
|
|
|
'name': 'WEBRIP',
|
|
|
|
}
|
|
|
|
'implementation': 'SourceSpecification',
|
|
|
|
},
|
|
|
|
'negate': true,
|
|
|
|
{
|
|
|
|
'required': true,
|
|
|
|
"name": "WEBRIP",
|
|
|
|
'fields': {
|
|
|
|
"implementation": "SourceSpecification",
|
|
|
|
'value': 8
|
|
|
|
"negate": true,
|
|
|
|
}
|
|
|
|
"required": true,
|
|
|
|
}
|
|
|
|
"fields": {
|
|
|
|
]
|
|
|
|
"value": 8
|
|
|
|
}";
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
""";
|
|
|
|
|
|
|
|
|
|
|
|
var result = sut.ParseCustomFormatData(jsonData, "file.json");
|
|
|
|
var result = sut.ParseCustomFormatData(jsonData, "file.json");
|
|
|
|
|
|
|
|
|
|
|
|
result.Should().BeEquivalentTo(new CustomFormatData
|
|
|
|
result.Should().BeEquivalentTo(new CustomFormatData
|
|
|
|
{
|
|
|
|
{
|
|
|
|
FileName = "file.json",
|
|
|
|
FileName = "file.json",
|
|
|
|
TrashId = "90cedc1fea7ea5d11298bebd3d1d3223",
|
|
|
|
TrashId = "90cedc1fea7ea5d11298bebd3d1d3223",
|
|
|
|
TrashScore = -10000,
|
|
|
|
TrashScores = {["default"] = -10000},
|
|
|
|
Name = "EVO (no WEBDL)",
|
|
|
|
Name = "EVO (no WEBDL)",
|
|
|
|
IncludeCustomFormatWhenRenaming = false,
|
|
|
|
IncludeCustomFormatWhenRenaming = false,
|
|
|
|
Specifications = new[]
|
|
|
|
Specifications = new[]
|
|
|
@ -113,7 +118,7 @@ public class CustomFormatParserTest
|
|
|
|
{
|
|
|
|
{
|
|
|
|
FileName = "file.json",
|
|
|
|
FileName = "file.json",
|
|
|
|
TrashId = "90cedc1fea7ea5d11298bebd3d1d3223",
|
|
|
|
TrashId = "90cedc1fea7ea5d11298bebd3d1d3223",
|
|
|
|
TrashScore = -10000,
|
|
|
|
TrashScores = {["default"] = -10000},
|
|
|
|
Name = "EVO (no WEBDL)",
|
|
|
|
Name = "EVO (no WEBDL)",
|
|
|
|
IncludeCustomFormatWhenRenaming = false
|
|
|
|
IncludeCustomFormatWhenRenaming = false
|
|
|
|
};
|
|
|
|
};
|
|
|
|