5dplomacy/MultiversalDiplomacyTests/Is.cs

60 lines
2.1 KiB
C#
Raw Normal View History

2022-03-23 05:11:14 +00:00
using MultiversalDiplomacy.Adjudicate;
using MultiversalDiplomacy.Adjudicate.Decision;
2022-03-23 05:11:14 +00:00
namespace MultiversalDiplomacyTests;
/// <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
{
/// <summary>
/// Returns a constraint that checks for a positive order validation.
/// </summary>
2022-03-23 05:11:14 +00:00
public static OrderValidationConstraint Valid
=> new(true, ValidationReason.Valid);
2022-03-23 05:11:14 +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)
=> new(false, expected);
/// <summary>
/// Returns a constraint that checks for a positive <see cref="IsDislodged"/> decision.
/// </summary>
public static OrderBinaryAdjudicationConstraint<IsDislodged> Dislodged
=> new(true);
/// <summary>
/// Returns a constraint that checks for a negative <see cref="IsDislodged"/> decision.
/// </summary>
public static OrderBinaryAdjudicationConstraint<IsDislodged> NotDislodged
=> new(false);
/// <summary>
/// Returns a constraint that checks for a positive <see cref="DoesMove"/> decision.
/// </summary>
public static OrderBinaryAdjudicationConstraint<DoesMove> Victorious
=> new(true);
/// <summary>
/// Returns a constraint that checks for a negative <see cref="DoesMove"/> decision.
/// </summary>
public static OrderBinaryAdjudicationConstraint<DoesMove> Repelled
=> new(false);
/// <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
}