Consider the code given below:

class MyGreeting {
 String value = "";
 void morningGreeting() => greeting="Good morning"
}

test('Greeting should be Good morning, () {
 /* Your Code goes here */
});

Which of the following code snippets should be placed inside test(), for checking whether on calling morningGreeting(), greeting is set to "Good morning"?

final greeting = MyGreeting();
greeting.morningGreeting();
expect(greeting.value, "Good morning");
MyGreeting.morningGreeting();
expect(greeting.value, "Good morning");
final greeting = MyGreeting();
greeting.morningGreeting();
expect(greeting.value == "Good morning");
final greeting = MyGreeting();
greeting.morningGreeting();
if(greeting.value == "Good morning")
	return true
else
	 return false
Correct Option - a

To get all Infosys Certified Flutter Developer Exam questions Join Group https://bit.ly/infy_premium_group

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in