Esempio n. 1
0
        public void WhenGetAllTrianglesThenShouldReturnAll()
        {
            var triangles = trianglesController.Get();
            int count     = 0;

            foreach (var triangle in triangles)
            {
                count++;
                printTriangleDetails(triangle);
            }
            Assert.IsTrue(count == 72);
        }
Esempio n. 2
0
        public void GetById(string input, string expected)
        {
            // Arrange
            TrianglesController controller = new TrianglesController();

            // Act
            string result = controller.Get(input);

            // Assert
            Assert.AreEqual(expected, result, input);
        }
Esempio n. 3
0
        public void Get()
        {
            // Arrange
            TrianglesController controller = new TrianglesController();

            // Act
            IEnumerable <string> result = controller.Get();

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(72, result.Count());
            Assert.AreEqual("{\"Row\":1,\"Col\":1,\"Location\":\"A1\",\"Vertices\":[\"0, 0\",\"10, 10\",\"0, 10\"]}", result.ElementAt(0));
        }