The global health crisis caused by the coronavirus SARS-CoV-2 has highlighted the importance of efficient disease detection and control strategies for minimizing the number of infections and deaths in the population and halting the spread of the pandemic. Countries have shown different preparedness levels for promptly implementing disease detection strategies, via mass testing and isolation of identified cases, which led to a largely varying impact of the outbreak on the populations and health-care systems. In this paper, we propose a new pandemic resource allocation model for allocating limited disease detection and control resources, in particular testing capacities, in order to limit the spread of a pandemic. The proposed model is a novel epidemiological compartmental model formulated as a non-linear programming model that is suitable to address the inherent non-linearity of an infectious disease progression within the population. A number of novel features are implemented in the model to take into account important disease characteristics, such as asymptomatic infection and the distinct risk levels of infection within different segments of the population. Moreover, a method is proposed to estimate the vulnerability level of the different communities impacted by the pandemic and to explicitly consider equity in the resource allocation problem. The model is validated against real data for a case study of COVID-19 outbreak in France and our results provide various insights on the optimal testing intervention time and level, and the impact of the optimal allocation of testing resources on the spread of the disease among regions. The results confirm the significance of the proposed modeling framework for informing policymakers on the best preparedness strategies against future infectious disease outbreaks.