Don't seperately parse status, let the JSON decoder do this for now
This commit is contained in:
+18
-1
@@ -18,7 +18,7 @@ public class CreateMissionLaunchTests
|
||||
{
|
||||
MissionId = Guid.NewGuid(),
|
||||
ScheduledFor = DateTimeOffset.UtcNow,
|
||||
Status = "Pending",
|
||||
Status = MissionLaunchStatus.Pending,
|
||||
};
|
||||
|
||||
await endpoint.HandleAsync(request, CancellationToken.None);
|
||||
@@ -27,4 +27,21 @@ public class CreateMissionLaunchTests
|
||||
|
||||
(await database.Context.MissionLaunches.AnyAsync()).ShouldBeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Rejects_empty_mission_id_guid()
|
||||
{
|
||||
var validator = new CreateMissionLaunchRequestValidator();
|
||||
|
||||
var result = validator.Validate(new CreateMissionLaunchRequest
|
||||
{
|
||||
MissionId = Guid.Empty,
|
||||
ScheduledFor = default,
|
||||
Status = MissionLaunchStatus.Pending,
|
||||
});
|
||||
|
||||
result.IsValid.ShouldBeFalse();
|
||||
result.Errors.ShouldContain(e => e.PropertyName == nameof(CreateMissionLaunchRequest.MissionId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user