public async Task CheckIfAdminCanCreateUsers_CreateUsersPerInstanceLimitWasReached_ReturnFalseResult() { // arrange var returnResult = false; var cxn = new SqlConnectionWrapperMock(); var repository = new SqlUserRepository(cxn.Object, cxn.Object); cxn.SetupExecuteScalarAsyncFunc("select dbo.CanCreateUsers()", null, returnResult); // act var result = await repository.CheckIfAdminCanCreateUsers(); // assert cxn.Verify(); Assert.AreEqual(returnResult, result); }