/** * 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 ValidCompanySecret() { string s = CommunicationValidation.IsCompanySecretValid(CompanyEnum.EAST_INDIA_TRADING, CompanySecrets.GetIndiaSecret()); NoError(s); }
public void InvalidCompanySecret() { string s = CommunicationValidation.IsCompanySecretValid(CompanyEnum.OCEANIC_AIRLINES, CompanySecrets.GetIndiaSecret()); IsError(s); }