private static IMediator CreateMediatorForUpdateUserRequest(string scenario) { IUpdateUserResult response = scenario switch { nameof(FailedToApplyUserModifications) => new FailedToApplyUserModifications(new [] { "Failed modification" }), nameof(NewerVersionOfUserRecordFound) => new NewerVersionOfUserRecordFound(Guid.NewGuid().ToString()), nameof(UserSuccessfullyUpdated) => new UserSuccessfullyUpdated(Guid.NewGuid().ToString()), nameof(UserNotFound) => UserNotFound.Instance }; var mediatorMock = new Mock <IMediator>(); mediatorMock.Setup(m => m.Send(It.IsAny <UpdateUser>(), default)).ReturnsAsync(response); return(mediatorMock.Object); }
public static bool IsEquivalentTo(this IUpdateUserResult actual, IUpdateUserResult expected) => actual switch {