public async Task WhenItem160705ThenPollOpt() { IHackerNewsService hackerNewsService = new HackerNewsService(); var item = await hackerNewsService.Item(new ItemId(160705)); if (item is PollOpt pollOpt) { Check.That(pollOpt.Id).IsEqualTo(160705); } }
public async Task WhenItem2921983ThenComment() { IHackerNewsService hackerNewsService = new HackerNewsService(); var item = await hackerNewsService.Item(new ItemId(2921983)); Check.That(item).IsInstanceOf <Comment>(); if (item is Comment comment) { Check.That(comment.Id).IsEqualTo(2921983); } }
public async Task WhenItem126809ThenPoll() { IHackerNewsService hackerNewsService = new HackerNewsService(); var item = await hackerNewsService.Item(new ItemId(126809)); Check.That(item).IsInstanceOf <Poll>(); if (item is Poll poll) { Check.That(poll.Id).IsEqualTo(126809); } }
public async Task WhenItem192327ThenJob() { IHackerNewsService hackerNewsService = new HackerNewsService(); var item = await hackerNewsService.Item(new ItemId(192327)); Check.That(item).IsInstanceOf <Job>(); if (item is Job job) { Check.That(job.Id).IsEqualTo(192327); } }