g to input the numbers I want instead. Like in main insetad of inputting the numbers myself, I wouldn't have to input the numbers after running the code because I would input them in the code before. Or is there a way I can create a test code to test certain dates first that are pre determined and I don't have to enter them? Here
can you help me please. this is my intital code but is there a way i can have set dates to be tested rather than me having to input the numbers I want instead. Like in main insetad of inputting the numbers myself, I wouldn't have to input the numbers after running the code because I would input them in the code before. Or is there a way I can create a test code to test certain dates first that are pre determined and I don't have to enter them? Here is my code below:
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
How do I set up my code to be tested if I am supposed to test it like this?
TEST(Date, 1) {
dateType date1(3, 15, 2008);
testing::internal::CaptureStdout();
// output date1.printDate();
std::string output = testing::internal::GetCapturedStdout();
ASSERT_TRUE(output == "3-15-2008");
ASSERT_TRUE(date1.isLeapYear()); }
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)