|
| 1 | +using ModularityKit.Mutator.Abstractions.Context; |
| 2 | +using ModularityKit.Mutator.Abstractions.Intent; |
| 3 | +using ModularityKit.Mutator.Governance.Abstractions.Lifecycle; |
| 4 | +using ModularityKit.Mutator.Governance.Abstractions.Requests; |
| 5 | + |
| 6 | +namespace ModularityKit.Mutator.Governance.Tests.TestSupport; |
| 7 | + |
| 8 | +internal static class MutationRequestTestFactory |
| 9 | +{ |
| 10 | + public static MutationRequest CreatePendingRequest() |
| 11 | + { |
| 12 | + return MutationRequest.Pending( |
| 13 | + stateId: "tenant-42:quota", |
| 14 | + stateType: "QuotaPolicy", |
| 15 | + mutationType: "IncreaseQuotaMutation", |
| 16 | + intent: new MutationIntent |
| 17 | + { |
| 18 | + OperationName = "IncreaseQuota", |
| 19 | + Category = "Billing", |
| 20 | + Description = "Raise quota" |
| 21 | + }, |
| 22 | + context: MutationContext.User("alice", "Alice", "Need more quota"), |
| 23 | + pendingReason: PendingMutationReason.Approval, |
| 24 | + expectedStateVersion: "v12"); |
| 25 | + } |
| 26 | + |
| 27 | + public static MutationRequest CreateApprovedSecurityRequest(string expectedStateVersion) |
| 28 | + { |
| 29 | + return MutationRequest.Approved( |
| 30 | + stateId: "tenant-42:roles", |
| 31 | + stateType: "IamRoleState", |
| 32 | + mutationType: "GrantRoleMutation", |
| 33 | + intent: new MutationIntent |
| 34 | + { |
| 35 | + OperationName = "GrantRole", |
| 36 | + Category = "Security", |
| 37 | + Description = "Grant elevated access" |
| 38 | + }, |
| 39 | + context: MutationContext.User("requester", "Requester", "Need access"), |
| 40 | + expectedStateVersion: expectedStateVersion); |
| 41 | + } |
| 42 | +} |
0 commit comments