This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
7 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
@isTest(SeeAllData=true) | ||
private class QuotaControllTest { | ||
|
||
private static User createUser(String username, String lastName, Boolean forecastEnabled) { | ||
private static User createUser(String username, String firstName, String lastName, Boolean forecastEnabled) { | ||
|
||
String alias = username.split('@').get(0); | ||
Profile profile = [ | ||
|
@@ -33,6 +33,7 @@ private class QuotaControllTest { | |
User user = new User( | ||
Username = username, | ||
Email = username, | ||
FirstName = firstName, | ||
LastName = lastName, | ||
Alias = alias, | ||
ProfileID = profile.Id, | ||
|
@@ -47,10 +48,10 @@ private class QuotaControllTest { | |
} | ||
|
||
static testMethod void getOnlyForecastingUsers() { | ||
User a = createUser('[email protected]', 'ForecastingUser', TRUE); | ||
User a = createUser('[email protected]', 'Fred', 'ForecastingUser', TRUE); | ||
|
||
|
||
User b = createUser('[email protected]', 'Non-ForecastingUser', FALSE); | ||
User b = createUser('[email protected]', 'Jane', 'Non-ForecastingUser', FALSE); | ||
|
||
|
||
// CurrencyUtil.getAvailableIsoCodes(); | ||
|
@@ -74,9 +75,9 @@ private class QuotaControllTest { | |
Boolean bFound = false; | ||
|
||
for (QuotaModel q : quotas.quotaRows) { | ||
if (q.ownerName.equals(a.Lastname)) | ||
if (q.ownerId.equals(a.Id)) | ||
aFound = true; | ||
if (q.ownerName.equals(b.Lastname)) | ||
if (q.ownerId.equals(b.Id)) | ||
bFound = true; | ||
} | ||
System.assert(aFound); | ||
|
@@ -86,7 +87,7 @@ private class QuotaControllTest { | |
|
||
static testMethod void updateQuotas() { | ||
String emaila = '[email protected]'; | ||
User a = createUser(emaila, 'ForecastingUser', TRUE); | ||
User a = createUser(emaila, 'Linda', 'ForecastingUser', TRUE); | ||
QuotaController qc = new QuotaController(); | ||
List<QuotaModel> ret = new List<QuotaModel>(); //qc.getQuotasForPeriod(Date.newInstance(date.today().year(), 3, 1), qc.quotaMap); | ||
|
||
|