• Ram S 49
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
Hi all, I am unable to run the below code in the visualPage. Kindly help me.
I am getting the below error.
"Unknown property 'Project__cStandardController.project' "

Here is the code

<apex:page standardController="Project__c">
    <apex:form>
    <h1>Project Quick Updtae</h1>
        <br/>
        Name : <apex:outputField value="{!project__c.Name}"/>
        <br/>
        Status:<apex:inputField value="{!project__c.Status__c}"/>
        <br/>
        Stage : <apex:inputField value="{!project__c.Stage__c}"/>
        <br />
        End Date : <apex:inputField value="{!project.End_Date__c}"/>
        <br/>
        Invoiced : <apex:inputField value="{!project.Invoiced__c}"/>
        <br/>
        <apex:commandButton value = "Update" action="!save"/>
        
    </apex:form>
    
</apex:page>


 
Hi All,
Need help with below test case

@isTest

private class TestTimecardManager{

@testSetup static void setup()
{
Contact conct = new contact(FirstName='Test', LastName='TestLastName', Phone='4565465789');

insert conct;

Project__c prj = new Project__c(Name ='MyProject');

insert prj;
}

@isTest static void TestInserMethodValid()
{

//code to access contact and project objects

Assignment__c assign = new Assignment__c(Contact__c=conct.Title,Project__c='MyProject',Start_Date__c=Date.parse('01/01/2019'),End_Date__c=Date.parse('10/01/2019'));

}
}


As you see I need to access the contact and project object in TestInserMethodValid() method.

Need your help!.
Method containing custom exception
/*
public static decimal CelsiusToKelvin (decimal degree)
    {
        if(degree<-273.16)
        { result = -273.16;
           throw new InvalidDataException('Value cannot be less than -273.16');
        }
}

*/

My Test method
class TemperatureTest {
@isTest static void testCelsiusToKelvin()
{
//What to do here?
}
}
 
Method containing custom exception
/*
public static decimal CelsiusToKelvin (decimal degree)
    {
        if(degree<-273.16)
        { result = -273.16;
           throw new InvalidDataException('Value cannot be less than -273.16');
        }
}

*/

My Test method
class TemperatureTest {
@isTest static void testCelsiusToKelvin()
{
//What to do here?
}
}