public ActionResult <string> Get() { var xmlTest = new XMLTest(); var result = xmlTest.TranslateXML(); return(new JsonResult(result)); }
public void XML() { var xmlTest = new XMLTest(); var result = xmlTest.TranslateXML(); Assert.IsNotNull(result); Assert.AreEqual("BE20210104DXBDXBCRU", result.CruiseCode); Assert.AreEqual("MSC BELLISSIMA", result.ShipName); Assert.AreEqual(106380, result.CabinValue); Assert.AreEqual(14000, result.PortCharge); Assert.AreEqual(1203800, result.TotalValue); // Assert.AreEqual(2, result.PassengerCruise.Count); // Assert.AreEqual(106380, result.PassengerCruise.Sum(x => x.Cruise.CabinValue)); // Assert.AreEqual(14000, result.PassengerCruise.Sum(x => x.Cruise.PortCharge)); // Assert.AreEqual(120380, result.PassengerCruise.Sum(x => x.Cruise.TotalValue)); // Assert.IsTrue(result.PassengerCruise.Any(x => x.PassengerCode == "-9999"),"No passenger -9999"); // Assert.IsTrue(result.PassengerCruise.Any(x => x.PassengerCode == "-9998"),"No passenger -9998"); Assert.Pass(); }
public CruiseDTO TranslateXML() { return(_xMLTest.TranslateXML()); }
public void Post([FromBody] string value) { XMLTest logic = new XMLTest(); logic.TranslateXML(); }