public void Get_ReturnsListDetail() { var mockRestClient = new Mock <IZyronatorRestClient>(); var mockRestResponse = new Mock <IRestResponse>(); mockRestResponse.Setup(resp => resp.Content).Returns(content); mockRestClient.Setup(rest => rest.Execute(It.IsAny <IRestRequest>())) .Returns(mockRestResponse.Object); DiscogsListDetailFetcher fetcher = new DiscogsListDetailFetcher(mockRestClient.Object); var listDetail = fetcher.Get(373143); mockRestClient.Verify(rest => rest.Execute(It.IsAny <IRestRequest>()), Times.Once); mockRestResponse.Verify(resp => resp.Content, Times.Once); Assert.IsNotNull(listDetail); Assert.IsTrue(listDetail.Items.Count == 1); Assert.AreEqual("(150613) Zyron Live on ISFM", listDetail.Name); Assert.AreEqual("No Artist - Environments(New Concepts In Stereo Sound - Disc 1)", listDetail.Items[0].DisplayTitle); }
public ZyronatorShared.DiscogsApiModels.DiscogsUserListDetail Get(int id) { DiscogsListDetailFetcher detailsFetcher = new DiscogsListDetailFetcher(_restClient); return(detailsFetcher.Get(id)); }