public async Task CheckForPresenceOfUserByEmailAddress_GivenUserDoesNotExist_ExpectNotPresentStatus() { var currentAuthenticatedUserProvider = new Mock <ICurrentAuthenticatedUserProvider>(); var connection = new Mock <IDbConnection>(); connection.SetupDapperAsync(c => c.QueryAsync <PresenceCheckDto <Guid> >( It.IsAny <string>(), It.IsAny <DynamicParameters>(), null, null, It.IsAny <CommandType>())) .ReturnsAsync(() => new List <PresenceCheckDto <Guid> >()); var dbConnectionProvider = new Mock <IConnectionProvider>(); dbConnectionProvider.Setup(x => x.GetConnection()) .Returns(() => connection.Object); var userQueries = new UserQueries(currentAuthenticatedUserProvider.Object, dbConnectionProvider.Object); var result = await userQueries.CheckForPresenceOfUserByEmailAddress("email-address"); Assert.False(result.IsPresent); }