Merge eureka/aetheria-release-ships-addon-frame-r4: ships authoring tool and add-on frame
# Conflicts: # tests/Aetheria.Shared.Tests/ShipSchemaPinTests.cs
This commit is contained in:
commit
54ac0fcfa7
16 changed files with 1897 additions and 163 deletions
|
|
@ -59,7 +59,25 @@ public sealed class ShipValidationTests
|
|||
{
|
||||
var ship = ShipAuthoringTests.Fixture();
|
||||
ship.WithId(id);
|
||||
Assert.Contains("ship ID must use", Assert.Throws<InvalidOperationException>(ship.Validate).Message);
|
||||
Assert.Contains("Ship ID must use", Assert.Throws<InvalidOperationException>(ship.Validate).Message);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("com0"), InlineData("console"), InlineData("lpt"), InlineData("auxiliary"), InlineData("a.con"), InlineData("com10")]
|
||||
public void IdsThatOnlyResembleDeviceNamesAreAdmitted(string id)
|
||||
{
|
||||
var ship = ShipAuthoringTests.Fixture();
|
||||
ship.WithId(id);
|
||||
ship.Validate();
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("con"), InlineData("abc.")]
|
||||
public void IdRefusalsNameNoValue(string id)
|
||||
{
|
||||
var ship = ShipAuthoringTests.Fixture();
|
||||
ship.WithId(id);
|
||||
Assert.DoesNotContain(id, Assert.Throws<InvalidOperationException>(ship.Validate).Message);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
|
@ -157,6 +175,10 @@ public sealed class ShipValidationTests
|
|||
|
||||
Add("id-null", s => s.Visual.Id = null, "Ship ID is required");
|
||||
Add("id-blank", s => s.Visual.Id = " ", "Ship ID is required");
|
||||
foreach (var device in new[] { "con", "prn", "aux", "nul", "nul.x", "com1", "com9", "lpt1", "lpt9", "con.txt" })
|
||||
Add("id-device-" + device, s => s.Visual.Id = device, "Windows device name");
|
||||
foreach (var id in new[] { "abc.", "a.", "ab.", "a.b." })
|
||||
Add("id-trailing-dot-" + id, s => s.Visual.Id = id, "must not end with a dot");
|
||||
Add("hull-null", s => s.Hull = null, "hull data is required");
|
||||
Add("hull-name-null", s => s.Hull.Name = null, "hull name is required");
|
||||
Add("hull-name-blank", s => s.Hull.Name = " ", "hull name is required");
|
||||
|
|
|
|||
Loading…
Reference in a new issue