public async Task ShouldCreateALoginsClientWithTheGivenToken( Snowflake discordUserId, Guid identityUserId, string accessToken, [Frozen, Substitute] IUsersClientFactory factory, [Target] DefaultUserService service, CancellationToken cancellationToken ) { await service.LinkDiscordIdToUser(discordUserId, identityUserId, accessToken, cancellationToken); factory.Received().Create(Is(accessToken)); }
public async Task ShouldCreateAUserLoginWithTheGivenInfo( Snowflake discordUserId, Guid identityUserId, string accessToken, [Frozen, Substitute] IUsersClient usersClient, [Target] DefaultUserService service, CancellationToken cancellationToken ) { await service.LinkDiscordIdToUser(discordUserId, identityUserId, accessToken, cancellationToken); await usersClient.Received().CreateLogin( Is(identityUserId), Is <CreateUserLoginRequest>(userLogin => userLogin.LoginProvider == "discord" && userLogin.ProviderKey == discordUserId ), Is(cancellationToken) ); }