• Rida Akhtar 9
  • NEWBIE
  • 21 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 7
    Replies
I've been working on the Getting Started with Apex Unit Tests  and have run into a speed bump on the challenge. I have 91% coverage and have one last line to figure out. I've tried various combinations of assert. without any success.

The error message is:
Error: Method does not exist or incorrect signature: VerifyDate.SetEndOfMonthDate(Datetime) 

The bold section of code has the issue. I'm not sure how to assert the method properly, if that is even the way to do it. The class/methods do exists.

@istest 
private class TestVerifyDate {
@isTest static void testCheckDates() {
    datetime dteDate1 = VerifyDate.CheckDates(Date.newInstance(2015, 1, 1), Date.newInstance(2015, 1, 10));
        if(VerifyDate.DateWithin30Days(Date.newInstance(2015, 1, 1),Date.newInstance(2015, 1, 10))) {
            System.assertEquals(Date.newInstance(2015, 1, 10),Date.newInstance(2015, 1, 10));
        } else {
           System.assert(VerifyDate.SetEndOfMonthDate(dteDate1));
        }    
}


Any thoughts or direction someone could point me in? Thanks.
This is to solve one of the trailhead challenge. 

How do we assign multiple values to an attribute by not using default paramenter instead value parameter. For example.

I have a component as below.

<aura:component name="DayOfTheWeek" type="string" value="Monday" : "Tuesday" : "Wednesday">

and I would like to read these values and find the week of the day dynamically, as we have $Browser and $Locale, do we have another binding variable to check on day, date and time values.

Thanks.
Help please - I am trying to complete the Lightning Challenge here:

https://developer.salesforce.com/trailhead/lightning_components/lightning_components_creating

But when I submit I am told it is wrong:

The component does not include an H1 tag with a 'headline' CSS class

My component reads:

<!-- MyLightningComponent.cmp -->
<aura:component implements="force:appHostable"> 
    <div class="headline">
        <H1>Hello Lightning Component!</H1>
    </div>    
</aura:component>

and I have a Style:

.THIS {
    background-color: yellow;
    padding-top: 10px;
}

H1.THIS {
    font-size:24px;
}

.THIS H1{
    font-weight: bold;
    padding: 10px;
}

.THIS.headline {
    padding-top: 20px;
    font-size:24px;
}

.THIS .red {
    background-color: red;
    padding: 10px;
}

.THIS .blue {
    background-color: blue;
    padding: 10px;
}

.THIS .green {
    background-color: green;
    padding: 10px;
}

Can anyone describe what I have done wrong?
Hi All,

Can anyone please help me with bellow challenge.


Create an Apex trigger for Account that matches Shipping Address Postal Code with Billing Address Postal Code based on a custom field.
For this challenge, you need to create a trigger that, before insert or update, checks for a checkbox, and if the checkbox field is true, sets the Shipping Postal Code (whose API name is ShippingPostalCode) to be the same as the Billing Postal Code (BillingPostalCode).The Apex trigger must be called 'AccountAddressTrigger'.
The Account object will need a new custom checkbox that should have the Field Label 'Match Billing Address' and Field Name of 'Match_Billing_Address'. The resulting API Name should be 'Match_Billing_Address__c'.
With 'AccountAddressTrigger' active, if an Account has a Billing Postal Code and 'Match_Billing_Address__c' is true, the record should have the Shipping Postal Code set to match on insert or update.

For above challenge i tried with following code but looks like it doesnt mach the requirement.

trigger AccountAddressTrigger on Account (before insert, before update) {
    for(Account a : Trigger.new){
        If (a.Match_Billing_Address__c = true) {
            /*ShippingPostalCode = BillingPostalCode;*/
        }   
    } 

}

Please help me