public static void MyClassCleanup() { if (_tempRule != null) { WebCallResult res = _tempRule.Delete(); Assert.IsTrue(res.Success, "Failed to delete temporary routing rule on cleanup."); } }
public void DeleteRoutingRule_ErrorResponse_Failure() { Reset(); _mockTransport.Setup(x => x.GetCupiResponse(It.IsAny <string>(), MethodType.DELETE, It.IsAny <ConnectionServerRest>(), It.IsAny <string>(), It.IsAny <bool>())).Returns(new WebCallResult { Success = false, ResponseText = "error text", StatusCode = 404 }); RoutingRule oRoutingRule = new RoutingRule(_mockServer, ""); var res = oRoutingRule.Delete(); Assert.IsFalse(res.Success, "Calling DeleteRoutingRule with ErrorResponse did not fail"); }