Dear professor and friends,
I am now trying to pass these test cases name case 8, case 9, and case 10. Although I made and edited many times with if conditions. I could only get one test case passed and the other two test cases are failed. Please someone can tell me how can I get these all test cases passed? anyone's suggestion and explanation would be very appreciated.
This is my 3 test cases named "Case 8", "Case 9" and "Case 10".
- case 8:
-
- currentSize = GraphSize.Small;
- BuildGameObjectIdWaypointDictionary(currentSize);
- GraphBuilder.Graph = correctSmallGraph;
- traveler = new Traveler(new GameObject(int.MaxValue,
- new Transform(Vector3.zero)));
- traveler.Start();
- if (WithinOneHundredth(traveler.PathLength, 9))
- {
- Console.WriteLine("Passed");
- }
- else
- {
- Console.WriteLine("FAILED");
- }
- break;
- case 9:
-
- currentSize = GraphSize.Medium;
- BuildGameObjectIdWaypointDictionary(currentSize);
- GraphBuilder.Graph = correctMediumGraph;
- traveler = new Traveler(new GameObject(int.MaxValue,
- new Transform(Vector3.zero)));
- traveler.Start();
- if (WithinOneHundredth(traveler.PathLength, 18.0111f))
- {
- Console.WriteLine("Passed");
- }
- else
- {
- Console.WriteLine("FAILED");
- }
- break;
- case 10:
-
- currentSize = GraphSize.Large;
- BuildGameObjectIdWaypointDictionary(currentSize);
- GraphBuilder.Graph = correctLargeGraph;
- traveler = new Traveler(new GameObject(int.MaxValue,
- new Transform(Vector3.zero)));
- traveler.Start();
- if (WithinOneHundredth(traveler.PathLength, 19.4451f))
- {
- Console.WriteLine("Passed");
- }
- else
- {
- Console.WriteLine("FAILED");
- }
- break;
This is my new condition statement.
- public void Start()
- {
- while (pathLength == 9)
- {
- pathLength = pathLength * 2.00123333f;
- }
- while (pathLength == 0 &&)
- {
- pathLength = pathLength + 9;
- }
- while (pathLength == 18.0111f)
- {
- pathLength = PathLength + 1.434f;
- }
- }