TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kaung Htet Kyaw
NA
66
6.4k
How should I do to pass all these test cases?
Aug 26 2020 12:45 AM
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:
// test Traveler class for small graph
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:
// test Traveler class for medium graph
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:
// test Traveler class for large graph
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;
}
}
Reply
Answers (
1
)
How to get my own created VSIX Extension to another Visual Studio Proj
Clasic Asp Crystal Report not working in Google Crome And Firefox