public void ScaleneTriangleTestMethod() { var expected = TriangleType.Scalene; var actual = TrianglesManager.GetType(1, 2, 5); Assert.AreEqual(expected, actual); }
public void EquilateralTriangleTestMethod() { var expected = TriangleType.Equilateral; var actual = TrianglesManager.GetType(1, 1, 1); Assert.AreEqual(expected, actual); }
public WhatShapeIsThisResponse WhatShapeIsThis(WhatShapeIsThisRequest request) { if (request == null) { throw new FaultException <ArgumentNullException>(new ArgumentNullException("request"), "null arguments are invalid"); } return(new WhatShapeIsThisResponse(TrianglesManager.GetType(request.a, request.b, request.c))); }
public void IsoscelesTriangleTestMethod() { var expected = TriangleType.Isosceles; var actual = TrianglesManager.GetType(1, 1, 5); Assert.AreEqual(expected, actual); actual = TrianglesManager.GetType(1, 5, 5); Assert.AreEqual(expected, actual); actual = TrianglesManager.GetType(5, 6, 5); Assert.AreEqual(expected, actual); }
public void TriangleInvalidParamsTestMethod() { var expected = TriangleType.Error; var actual = TrianglesManager.GetType(-1, 1, 1); Assert.AreEqual(expected, actual); actual = TrianglesManager.GetType(1, 0, 1); Assert.AreEqual(expected, actual); actual = TrianglesManager.GetType(1, 1, -1); Assert.AreEqual(expected, actual); }
public async Task <WhatShapeIsThisResponse> WhatShapeIsThisAsync(WhatShapeIsThisRequest request) { if (request == null) { throw new FaultException <ArgumentNullException>(new ArgumentNullException("request"), "null arguments are invalid"); } return(await Task.Run <WhatShapeIsThisResponse>(() => new WhatShapeIsThisResponse(TrianglesManager.GetType(request.a, request.b, request.c)) )); }