Exemple #1
0
        public async Task AddRecord_CorrectRecordAdded()
        {
            ISSTrackerApi api = new ISSTrackerApi();
            await api.AddRecord();

            Assert.AreEqual(1, api.RecordCount());
        }
Exemple #2
0
        public async Task CalculateDistance_ReturnValue()
        {
            ISSTrackerApi api = new ISSTrackerApi();
            await api.AddRecord();

            await api.AddRecord();

            Assert.AreNotEqual(0, api.CalculateDistanceFromAllRecords());
        }
Exemple #3
0
        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();
            }
        }
Exemple #4
0
        public void CalculateDistance_LessThan2Records_Throws()
        {
            ISSTrackerApi api = new ISSTrackerApi();

            Assert.Throws <InvalidOperationException>(() => api.CalculateISSSpeed());
        }
Exemple #5
0
        public void CalculateSpeed_ReturnValue()
        {
            ISSTrackerApi api = new ISSTrackerApi();

            Assert.Throws <InvalidOperationException>(() => api.CalculateISSSpeed());
        }
Exemple #6
0
        public void AddRecord_NoConnection_Throws()
        {
            ISSTrackerApi api = new ISSTrackerApi();

            Assert.ThrowsAsync <HttpRequestException>(async() => await api.AddRecord());
        }