SlideShare a Scribd company logo
How do you create a unit test for a method that takes no parameters, but returns an integer with
unknown user input:
Scaner scanner = new Scanner(System.in);
public int sumNumbers(){
System.out.print("Enter first number");
int numberOne = scanner.nextInt();
System.out.print("Enter second number");
int numberTwo - scanner.nexInt();
return numberOne + numberTwo;
}

More Related Content

More from krishnac481

How is long-run economic growth measured- What is the basis of long-ru.pdf
How is long-run economic growth measured- What is the basis of long-ru.pdfHow is long-run economic growth measured- What is the basis of long-ru.pdf
How is long-run economic growth measured- What is the basis of long-ru.pdf
krishnac481
 
How do I calculate the following for relative error by hand- I'm aware.pdf
How do I calculate the following for relative error by hand- I'm aware.pdfHow do I calculate the following for relative error by hand- I'm aware.pdf
How do I calculate the following for relative error by hand- I'm aware.pdf
krishnac481
 
How is global human resource management different from domestic HRM- Q.pdf
How is global human resource management different from domestic HRM- Q.pdfHow is global human resource management different from domestic HRM- Q.pdf
How is global human resource management different from domestic HRM- Q.pdf
krishnac481
 
How has Europe benefited from its location and its major physical feat.pdf
How has Europe benefited from its location and its major physical feat.pdfHow has Europe benefited from its location and its major physical feat.pdf
How has Europe benefited from its location and its major physical feat.pdf
krishnac481
 
How each of this happens and their clinical correlates-a- Inversion du.pdf
How each of this happens and their clinical correlates-a- Inversion du.pdfHow each of this happens and their clinical correlates-a- Inversion du.pdf
How each of this happens and their clinical correlates-a- Inversion du.pdf
krishnac481
 
How is the beginning of intramembranous ossification different from en.pdf
How is the beginning of intramembranous ossification different from en.pdfHow is the beginning of intramembranous ossification different from en.pdf
How is the beginning of intramembranous ossification different from en.pdf
krishnac481
 
How do the architecture and design of these systems reflect the functi.pdf
How do the architecture and design of these systems reflect the functi.pdfHow do the architecture and design of these systems reflect the functi.pdf
How do the architecture and design of these systems reflect the functi.pdf
krishnac481
 
How does the fluid mosaic model represents the structure of the plasma.pdf
How does the fluid mosaic model represents the structure of the plasma.pdfHow does the fluid mosaic model represents the structure of the plasma.pdf
How does the fluid mosaic model represents the structure of the plasma.pdf
krishnac481
 
How do you differentiate a crypto exchange from a traditional stock ex.pdf
How do you differentiate a crypto exchange from a traditional stock ex.pdfHow do you differentiate a crypto exchange from a traditional stock ex.pdf
How do you differentiate a crypto exchange from a traditional stock ex.pdf
krishnac481
 
How does the heterozygous condition for sickle cell disease confer an.pdf
How does the heterozygous condition for sickle cell disease confer an.pdfHow does the heterozygous condition for sickle cell disease confer an.pdf
How does the heterozygous condition for sickle cell disease confer an.pdf
krishnac481
 
How does Celebrity Cruises collect data about the customer experience-.pdf
How does Celebrity Cruises collect data about the customer experience-.pdfHow does Celebrity Cruises collect data about the customer experience-.pdf
How does Celebrity Cruises collect data about the customer experience-.pdf
krishnac481
 
How do retail stores display their merchandise taking into account sub.pdf
How do retail stores display their merchandise taking into account sub.pdfHow do retail stores display their merchandise taking into account sub.pdf
How do retail stores display their merchandise taking into account sub.pdf
krishnac481
 
How does Saturn's F ring stay so thin (narrow)- when the other rings a.pdf
How does Saturn's F ring stay so thin (narrow)- when the other rings a.pdfHow does Saturn's F ring stay so thin (narrow)- when the other rings a.pdf
How does Saturn's F ring stay so thin (narrow)- when the other rings a.pdf
krishnac481
 
How do chemoheterotrophs- chemoautotrophs- photoautotrophs and photohe.pdf
How do chemoheterotrophs- chemoautotrophs- photoautotrophs and photohe.pdfHow do chemoheterotrophs- chemoautotrophs- photoautotrophs and photohe.pdf
How do chemoheterotrophs- chemoautotrophs- photoautotrophs and photohe.pdf
krishnac481
 
How does the FASB's conceptual framework influence the development of.pdf
How does the FASB's conceptual framework influence the development of.pdfHow does the FASB's conceptual framework influence the development of.pdf
How does the FASB's conceptual framework influence the development of.pdf
krishnac481
 
How can you explain the substantial lag between a signal and response.pdf
How can you explain the substantial lag between a signal and response.pdfHow can you explain the substantial lag between a signal and response.pdf
How can you explain the substantial lag between a signal and response.pdf
krishnac481
 
How do you address differing values in standards of infection control-.pdf
How do you address differing values in standards of infection control-.pdfHow do you address differing values in standards of infection control-.pdf
How do you address differing values in standards of infection control-.pdf
krishnac481
 
How do I find this information in a research article- What were the m.pdf
How do I find this information in a research article-  What were the m.pdfHow do I find this information in a research article-  What were the m.pdf
How do I find this information in a research article- What were the m.pdf
krishnac481
 
How do I do this- Language-Type- Java classes constructors Critters f.pdf
How do I do this- Language-Type-  Java classes constructors Critters f.pdfHow do I do this- Language-Type-  Java classes constructors Critters f.pdf
How do I do this- Language-Type- Java classes constructors Critters f.pdf
krishnac481
 
Hyaline cartilage is found in the outer -shell- of a bone the inner -f.pdf
Hyaline cartilage is found in the outer -shell- of a bone the inner -f.pdfHyaline cartilage is found in the outer -shell- of a bone the inner -f.pdf
Hyaline cartilage is found in the outer -shell- of a bone the inner -f.pdf
krishnac481
 

More from krishnac481 (20)

How is long-run economic growth measured- What is the basis of long-ru.pdf
How is long-run economic growth measured- What is the basis of long-ru.pdfHow is long-run economic growth measured- What is the basis of long-ru.pdf
How is long-run economic growth measured- What is the basis of long-ru.pdf
 
How do I calculate the following for relative error by hand- I'm aware.pdf
How do I calculate the following for relative error by hand- I'm aware.pdfHow do I calculate the following for relative error by hand- I'm aware.pdf
How do I calculate the following for relative error by hand- I'm aware.pdf
 
How is global human resource management different from domestic HRM- Q.pdf
How is global human resource management different from domestic HRM- Q.pdfHow is global human resource management different from domestic HRM- Q.pdf
How is global human resource management different from domestic HRM- Q.pdf
 
How has Europe benefited from its location and its major physical feat.pdf
How has Europe benefited from its location and its major physical feat.pdfHow has Europe benefited from its location and its major physical feat.pdf
How has Europe benefited from its location and its major physical feat.pdf
 
How each of this happens and their clinical correlates-a- Inversion du.pdf
How each of this happens and their clinical correlates-a- Inversion du.pdfHow each of this happens and their clinical correlates-a- Inversion du.pdf
How each of this happens and their clinical correlates-a- Inversion du.pdf
 
How is the beginning of intramembranous ossification different from en.pdf
How is the beginning of intramembranous ossification different from en.pdfHow is the beginning of intramembranous ossification different from en.pdf
How is the beginning of intramembranous ossification different from en.pdf
 
How do the architecture and design of these systems reflect the functi.pdf
How do the architecture and design of these systems reflect the functi.pdfHow do the architecture and design of these systems reflect the functi.pdf
How do the architecture and design of these systems reflect the functi.pdf
 
How does the fluid mosaic model represents the structure of the plasma.pdf
How does the fluid mosaic model represents the structure of the plasma.pdfHow does the fluid mosaic model represents the structure of the plasma.pdf
How does the fluid mosaic model represents the structure of the plasma.pdf
 
How do you differentiate a crypto exchange from a traditional stock ex.pdf
How do you differentiate a crypto exchange from a traditional stock ex.pdfHow do you differentiate a crypto exchange from a traditional stock ex.pdf
How do you differentiate a crypto exchange from a traditional stock ex.pdf
 
How does the heterozygous condition for sickle cell disease confer an.pdf
How does the heterozygous condition for sickle cell disease confer an.pdfHow does the heterozygous condition for sickle cell disease confer an.pdf
How does the heterozygous condition for sickle cell disease confer an.pdf
 
How does Celebrity Cruises collect data about the customer experience-.pdf
How does Celebrity Cruises collect data about the customer experience-.pdfHow does Celebrity Cruises collect data about the customer experience-.pdf
How does Celebrity Cruises collect data about the customer experience-.pdf
 
How do retail stores display their merchandise taking into account sub.pdf
How do retail stores display their merchandise taking into account sub.pdfHow do retail stores display their merchandise taking into account sub.pdf
How do retail stores display their merchandise taking into account sub.pdf
 
How does Saturn's F ring stay so thin (narrow)- when the other rings a.pdf
How does Saturn's F ring stay so thin (narrow)- when the other rings a.pdfHow does Saturn's F ring stay so thin (narrow)- when the other rings a.pdf
How does Saturn's F ring stay so thin (narrow)- when the other rings a.pdf
 
How do chemoheterotrophs- chemoautotrophs- photoautotrophs and photohe.pdf
How do chemoheterotrophs- chemoautotrophs- photoautotrophs and photohe.pdfHow do chemoheterotrophs- chemoautotrophs- photoautotrophs and photohe.pdf
How do chemoheterotrophs- chemoautotrophs- photoautotrophs and photohe.pdf
 
How does the FASB's conceptual framework influence the development of.pdf
How does the FASB's conceptual framework influence the development of.pdfHow does the FASB's conceptual framework influence the development of.pdf
How does the FASB's conceptual framework influence the development of.pdf
 
How can you explain the substantial lag between a signal and response.pdf
How can you explain the substantial lag between a signal and response.pdfHow can you explain the substantial lag between a signal and response.pdf
How can you explain the substantial lag between a signal and response.pdf
 
How do you address differing values in standards of infection control-.pdf
How do you address differing values in standards of infection control-.pdfHow do you address differing values in standards of infection control-.pdf
How do you address differing values in standards of infection control-.pdf
 
How do I find this information in a research article- What were the m.pdf
How do I find this information in a research article-  What were the m.pdfHow do I find this information in a research article-  What were the m.pdf
How do I find this information in a research article- What were the m.pdf
 
How do I do this- Language-Type- Java classes constructors Critters f.pdf
How do I do this- Language-Type-  Java classes constructors Critters f.pdfHow do I do this- Language-Type-  Java classes constructors Critters f.pdf
How do I do this- Language-Type- Java classes constructors Critters f.pdf
 
Hyaline cartilage is found in the outer -shell- of a bone the inner -f.pdf
Hyaline cartilage is found in the outer -shell- of a bone the inner -f.pdfHyaline cartilage is found in the outer -shell- of a bone the inner -f.pdf
Hyaline cartilage is found in the outer -shell- of a bone the inner -f.pdf
 

Recently uploaded

The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 

Recently uploaded (20)

The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 

How do you create a unit test for a method that takes no parameters- b.pdf

  • 1. How do you create a unit test for a method that takes no parameters, but returns an integer with unknown user input: Scaner scanner = new Scanner(System.in); public int sumNumbers(){ System.out.print("Enter first number"); int numberOne = scanner.nextInt(); System.out.print("Enter second number"); int numberTwo - scanner.nexInt(); return numberOne + numberTwo; }