2022-03-23 05:11:14 +00:00
|
|
|
using MultiversalDiplomacy.Adjudicate;
|
2022-03-28 22:05:04 +00:00
|
|
|
using MultiversalDiplomacy.Adjudicate.Decision;
|
2022-03-23 05:11:14 +00:00
|
|
|
|
|
|
|
namespace MultiversalDiplomacyTests;
|
|
|
|
|
2022-03-30 20:00:51 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Multiversal Diplomacy assertion constraint extension provider. "NotX" constraints are provided
|
|
|
|
/// because properties can't be added to Is.Not via extension.
|
|
|
|
/// </summary>
|
2022-03-23 05:11:14 +00:00
|
|
|
public class Is : NUnit.Framework.Is
|
|
|
|
{
|
2022-03-30 20:00:51 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Returns a constraint that checks for a positive order validation.
|
|
|
|
/// </summary>
|
2022-03-23 05:11:14 +00:00
|
|
|
public static OrderValidationConstraint Valid
|
2022-03-28 22:05:04 +00:00
|
|
|
=> new(true, ValidationReason.Valid);
|
2022-03-23 05:11:14 +00:00
|
|
|
|
2022-03-30 20:00:51 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Returns a constraint that checks for a negative order validation.
|
|
|
|
/// </summary>
|
2022-03-23 05:11:14 +00:00
|
|
|
public static OrderValidationConstraint Invalid(ValidationReason expected)
|
2022-03-28 22:05:04 +00:00
|
|
|
=> new(false, expected);
|
|
|
|
|
2022-03-30 20:00:51 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Returns a constraint that checks for a positive <see cref="IsDislodged"/> decision.
|
|
|
|
/// </summary>
|
2022-03-28 22:05:04 +00:00
|
|
|
public static OrderBinaryAdjudicationConstraint<IsDislodged> Dislodged
|
|
|
|
=> new(true);
|
|
|
|
|
2022-03-30 20:00:51 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Returns a constraint that checks for a negative <see cref="IsDislodged"/> decision.
|
|
|
|
/// </summary>
|
2022-03-28 22:05:04 +00:00
|
|
|
public static OrderBinaryAdjudicationConstraint<IsDislodged> NotDislodged
|
|
|
|
=> new(false);
|
|
|
|
|
2022-03-30 20:00:51 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Returns a constraint that checks for a positive <see cref="DoesMove"/> decision.
|
|
|
|
/// </summary>
|
2022-03-28 22:05:04 +00:00
|
|
|
public static OrderBinaryAdjudicationConstraint<DoesMove> Victorious
|
|
|
|
=> new(true);
|
|
|
|
|
2022-03-30 20:00:51 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Returns a constraint that checks for a negative <see cref="DoesMove"/> decision.
|
|
|
|
/// </summary>
|
2022-03-28 22:05:04 +00:00
|
|
|
public static OrderBinaryAdjudicationConstraint<DoesMove> Repelled
|
|
|
|
=> new(false);
|
2022-03-30 20:00:51 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Returns a constraint that checks for a positive <see cref="GivesSupport"/> decision.
|
|
|
|
/// </summary>
|
|
|
|
public static OrderBinaryAdjudicationConstraint<GivesSupport> NotCut
|
|
|
|
=> new(true);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Returns a constraint that checks for a negative <see cref="GivesSupport"/> decision.
|
|
|
|
/// </summary>
|
|
|
|
public static OrderBinaryAdjudicationConstraint<GivesSupport> Cut
|
|
|
|
=> new(false);
|
2022-03-23 05:11:14 +00:00
|
|
|
}
|