function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
badri nath 9badri nath 9 

Please provide a test class i am getting only 80% code coverage?

<apex:page controller="c1" sidebar="false" docType="Html-5.0" id="page1"  tabStyle="account">
<apex:form >
<apex:pageBlock >

<apex:inputText value="{!name}" />
<apex:commandButton value="search" action="{!search}"/>
<apex:pageblocktable value="{!acts}" var="a">
<apex:column value="{!}"/>
<apex:column value="{!}"/>
<apex:column value="{!a.type}"/>


controller class:

public with sharing class c1 {
      public String name { get; set; }

    public list<account> acts { get; set; }

    public PageReference search() {
     acts=[select id,type,name from account where name like 'b%'];
        return null;
Best Answer chosen by badri nath 9
Devanshu soodDevanshu sood
public class testsearch {
    static void testserach1(){
        Account acc=new Account(name='btest',website = '');
        insert acc;
        c1 c=new c1();;'b';


100% code coverage