public object Get([FromQuery] int coord1, int coord2, int coord3, int coord4, int coord5, int coord6) { int[] coords1 = { coord1, coord2 }; int[] coords2 = { coord3, coord4 }; int[] coords3 = { coord5, coord6 }; List <int[]> coords = new List <int[]>() { coords1, coords2, coords3 }; return(TriangleProvider.GetTriangleByCoords(coords)); }
public void TestGetTriangleByCoords() { List <int[]> coords = new List <int[]> { }; int[] coord1 = new int[] { 50, 50 }; coords.Add(coord1); int[] coord2 = new int[] { 60, 50 }; coords.Add(coord2); int[] coord3 = new int[] { 60, 60 }; coords.Add(coord3); var result = TriangleProvider.GetTriangleByCoords(coords); string keyValue = @"{""Key"":""F12"",""Value"":[[50,50],[60,50],[60,60]]}"; Assert.Equal(result, keyValue); }