public void WeaponNotAllowed() { string s = CommunicationValidation.VerifyTelstarRequest(new TelstarRequest { Company = CompanyEnum.TELSTAR_LOGISTICS.ToString(), SecretCompanyCode = CompanySecrets.GetTelstarSecret(), CityFrom = CityEnum.KAPSTADEN.ToString(), CityTo = CityEnum.HVALBUGTEN.ToString(), Features = new string[] { FeatureEnum.WEAPONS.ToString() }, Height = 2, Length = 2, Width = 2, Weight = 2 }); IsError(s); }
public TelstarResponse Get([FromBody] TelstarRequest telstarRequest) { string errorMsg = CommunicationValidation.VerifyTelstarRequest(telstarRequest); if (errorMsg != null) { return(returnError(errorMsg)); } RoutesDAO routesDAO = new RoutesDAO(); Routes routes = routesDAO.FetchOne(GetId(telstarRequest.CityTo), GetId(telstarRequest.CityFrom)); return(new TelstarResponse { price = GetPrice(telstarRequest, routes.Price), time = routes.TravelTime, error = "NO_ERROR" }); }