Answered step by step
Verified Expert Solution
Question
1 Approved Answer
import org.junit.Test; import static org.junit.Assert.*; public class ConversionFunctionsTest { // celsiusToFahrenheit tests --------------------------------------------------------------------------- @Test public void celsius0IsFahrenheit32() { assertEquals(32, ConversionFunctions.celsiusToFahrenheit(0)); } @Test public void celsius16IsFahrenheit61()
import org.junit.Test; import static org.junit.Assert.*; public class ConversionFunctionsTest { // celsiusToFahrenheit tests --------------------------------------------------------------------------- @Test public void celsius0IsFahrenheit32() { assertEquals(32, ConversionFunctions.celsiusToFahrenheit(0)); } @Test public void celsius16IsFahrenheit61() { assertEquals(61, ConversionFunctions.celsiusToFahrenheit(16)); } // TODO: Write a test for a negative celsius that converts to a positive fahrenheit // TODO: Write a test for a negative celsius that converts to a negative fahrenheit // TODO: Write a test for a celsius value that converts to 0 fahrenheit // cupsToTablespoons tests --------------------------------------------------------------------------- // TODO: Write a test for 0 cups converts to 0 tablespoons - run the test & see that it passes // TODO: Write a test for 1 cup converts to 16 tablespoons // TODO: Run the test & see that it fails. Failing tests reveal bugs. // TODO: Fix the implementation of cupsToTablespoons so that this test passes // TODO: Write one or two additional tests for cupsToTablespoons // monthNumToMonthName tests --------------------------------------------------------------------------- // TODO: Complete the test below so that it tests all valid months @Test public void months1through12AreJanuaryThroughDecember() { assertEquals("january", ConversionFunctions.monthNumToMonthName(1).toLowerCase()); assertEquals("february", ConversionFunctions.monthNumToMonthName(2).toLowerCase()); } // TODO: Complete the test below for a variety of invalid month numbers; be sure to include bounds // TODO: Run the test and see that it fails. Failing tests reveal bugs. // TODO: Fix the implementation of monthNumToMonthName so that this test passes @Test public void invalidMonthReturnsEmptyString() { } }
Tasks:
- Complete the TODOs in ConversionFunctionsTest, writing tests, and fixing bugs.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started