/** * Check that the company secret is valid */ public static string IsCompanySecretValid(CompanyEnum company, string secret) { switch (company) { case CompanyEnum.OCEANIC_AIRLINES: if (!secret.Equals(CompanySecrets.GetOceanicSecret())) { return("Invalid secret"); } break; case CompanyEnum.EAST_INDIA_TRADING: if (!secret.Equals(CompanySecrets.GetIndiaSecret())) { return("Invalid secret"); } break; case CompanyEnum.TELSTAR_LOGISTICS: if (!secret.Equals(CompanySecrets.GetTelstarSecret())) { return("Invalid secret"); } break; } return(null); }
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); }