Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace NUnitTestProject1
- {
- public class RouteTest
- {
- Route route;
- [SetUp]
- public void Setup()
- {
- route = new Route();
- }
- [Test]
- public void Test_List_Count()
- {
- route.Add_Point(2, 0, 0);
- route.Add_Point(4, 0, 1);
- route.Add_Point(3, 0, 2);
- int pointCount = route.Get_ListCount();
- Assert.AreEqual(3, pointCount);
- }
- [Test]
- public void Test_Remove_Point()
- {
- route.Add_Point(2, 0, 0);
- route.Add_Point(4, 0, 1);
- route.Add_Point(3, 0, 2);
- route.Remove_Point(1);
- int pointCount = route.Get_ListCount();
- Assert.AreEqual(2, pointCount);
- }
- [Test]
- public void Test_Remove_Point2()
- {
- route.Add_Point(2, 0, 0);
- route.Add_Point(3, 0, 1);
- route.Add_Point(34, 0, 2);
- route.Add_Point(5, 0, 1);
- route.Remove_Point(1);
- int pointCount = route.Get_ListCount();
- Assert.AreEqual(3, pointCount);
- }
- [Test]
- public void Test_Get_Length()
- {
- route.Add_Point(2, 0, 0);
- route.Add_Point(3, 0, 1);
- route.Add_Point(7, 0, 2);
- route.Add_Point(10, 0, 3);
- double routeLength = route.Get_Length();
- Assert.AreEqual(8, routeLength);
- }
- [Test]
- public void Test_Get_Length_count0()
- {
- route.Add_Point(2, 0, 0);
- double routeLength = route.Get_Length();
- Assert.AreEqual(0, routeLength);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement