public async Task GetModuleTest() { IVatsim vatsim = await VatsimAPI.GetModule(); Assert.That(vatsim, Is.Not.Null); Assert.That(vatsim.Data, Is.Not.Null); Assert.That(vatsim.GetMessages(), Is.Not.Null); Assert.That(await vatsim.GetMETAR("KCLE"), Is.Not.Null.Or.Empty); }
/// <summary> /// Gets a new IVatsim instance. /// </summary> /// <returns>A new IVatsim instance.</returns> public static async Task <IVatsim> GetModule() { VatsimStatusLoader statusLoader = new VatsimStatusLoader(); VatsimStatus status = new VatsimStatus(statusLoader); await status.Initialize(); VatsimDataLoader dataLoader = new VatsimDataLoader(); VatsimData data = new VatsimData(dataLoader, status); MetarDataLoader metarLoader = new MetarDataLoader(); return(_vatsim ?? (_vatsim = new Vatsim(status, data, metarLoader))); }