Merge commit '5135a036' into remed/lane-S7
This commit is contained in:
@@ -169,4 +169,26 @@ public sealed class FocasTagConfigModelTests
|
||||
[InlineData("""{"address":"R100","dataType":2}""")]
|
||||
public void Validate_accepts_every_dataType_the_driver_accepts(string json)
|
||||
=> FocasTagConfigModel.FromJson(json).Validate().ShouldBeNull();
|
||||
|
||||
/// <summary>
|
||||
/// #740 / R07:U8 — String on a PMC / PARAM / MACRO address is refused by the driver (no area read
|
||||
/// returns text), so the modal refuses it too, for a model built in the editor and for a loaded blob.
|
||||
/// </summary>
|
||||
[Theory]
|
||||
[InlineData("R100")]
|
||||
[InlineData("PARAM:6711")]
|
||||
[InlineData("MACRO:500")]
|
||||
public void Validate_refuses_string_on_an_area_address(string address)
|
||||
{
|
||||
new FocasTagConfigModel { Address = address, DataType = FocasDataType.String }
|
||||
.Validate().ShouldNotBeNull().ShouldContain("String");
|
||||
FocasTagConfigModel.FromJson($$"""{"address":"{{address}}","dataType":"String"}""")
|
||||
.Validate().ShouldNotBeNull().ShouldContain("String");
|
||||
}
|
||||
|
||||
/// <summary>Positive control: the fixed tree's string fields keep String.</summary>
|
||||
[Fact]
|
||||
public void Validate_accepts_string_on_a_fixed_tree_path()
|
||||
=> new FocasTagConfigModel { Address = "FIXED:Identity/SeriesNumber", DataType = FocasDataType.String }
|
||||
.Validate().ShouldBeNull();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user