public async Task AddRecord_CorrectRecordAdded() { ISSTrackerApi api = new ISSTrackerApi(); await api.AddRecord(); Assert.AreEqual(1, api.RecordCount()); }
public async Task CalculateDistance_ReturnValue() { ISSTrackerApi api = new ISSTrackerApi(); await api.AddRecord(); await api.AddRecord(); Assert.AreNotEqual(0, api.CalculateDistanceFromAllRecords()); }
static void Main(string[] args) { ISSTrackerApi api = new ISSTrackerApi(); string userAnswear = ""; bool firstRun = true; while (userAnswear != "q") { if (!firstRun) { Console.Clear(); if (api.ErrorLogs != "") { Console.WriteLine(api.ErrorLogs + Environment.NewLine); api.ErrorLogs = ""; } Console.WriteLine(api.UserAnswearInterpreter(userAnswear)); } firstRun = false; Console.Write(api.ShowMenu()); userAnswear = Console.ReadLine(); } }
public void CalculateDistance_LessThan2Records_Throws() { ISSTrackerApi api = new ISSTrackerApi(); Assert.Throws <InvalidOperationException>(() => api.CalculateISSSpeed()); }
public void CalculateSpeed_ReturnValue() { ISSTrackerApi api = new ISSTrackerApi(); Assert.Throws <InvalidOperationException>(() => api.CalculateISSSpeed()); }
public void AddRecord_NoConnection_Throws() { ISSTrackerApi api = new ISSTrackerApi(); Assert.ThrowsAsync <HttpRequestException>(async() => await api.AddRecord()); }