Пример #1
0
        public async Task Should_Return_Movie()
        {
            // when
            var result = await _sut.GetRating("Jurassic Park");

            // then
            Assert.AreEqual("Jurassic Park", result.Title);
        }
Пример #2
0
        public async Task StartAsync(CancellationToken cancellationToken = new CancellationToken())
        {
            do
            {
                Console.WriteLine("Enter Movie Title");
                var title = Console.ReadLine();

                if (!string.IsNullOrWhiteSpace(title))
                {
                    var response = await _omdbService.GetRating(title);

                    if (!string.IsNullOrWhiteSpace(response.Title))
                    {
                        Console.WriteLine($"OMDB Movie Rating is {response.imdbRating} released on {response.Year}");
                        Console.WriteLine("Do you want to continue again? (Y/N)");
                    }
                    else
                    {
                        Console.WriteLine($"No Movie found!");
                        Console.ReadKey();
                    }
                }
            }while (Console.ReadKey().Key == ConsoleKey.Y);
        }