Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Fixes #41
Browse files Browse the repository at this point in the history
  • Loading branch information
alonkama committed Mar 5, 2017
1 parent 9bcd714 commit 22808fa
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/classes/QuotaControllTest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -33,6 +33,7 @@ private class QuotaControllTest {
User user = new User(
Username = username,
Email = username,
FirstName = firstName,
LastName = lastName,
Alias = alias,
ProfileID = profile.Id,
Expand All @@ -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();
Expand All @@ -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);
Expand All @@ -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);

Expand Down

0 comments on commit 22808fa

Please sign in to comment.