예제 #1
0
        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);
        }
예제 #2
0
 public static bool IsEquivalentTo(this IUpdateUserResult actual, IUpdateUserResult expected) =>
 actual switch
 {