public void ListAll_ReturnsNonEmptyListWhenPackagesAreAvailable() { // Returned content var mpl = new ResponseWithContentBody <List <PackageHeader> > { content = new List <PackageHeader>() { new PackageHeader() }, success = true }; // Returns mpl for any arguments var c = new Mock <IGregClient>(); c.Setup(x => x.ExecuteAndDeserializeWithContent <List <PackageHeader> >(It.IsAny <HeaderCollectionDownload>())) .Returns(mpl); var m = new PackageManagerClient(c.Object, MockMaker.Empty <IPackageUploadBuilder>()); var pl = m.ListAll(); Assert.AreNotEqual(0, pl.Count()); }
public void ListAll_ReturnsEmptyListWhenQueryThrowsException() { // Returns mpl for any arguments var c = new Mock<IGregClient>(); c.Setup(x => x.ExecuteAndDeserializeWithContent<List<PackageHeader>>(It.IsAny<HeaderCollectionDownload>())) .Throws(new Exception("Fail!")); var m = new PackageManagerClient(c.Object, MockMaker.Empty<IPackageUploadBuilder>(), ""); var pl = m.ListAll(); Assert.AreEqual(0, pl.Count()); }
public void ListAll_ReturnsEmptyListWhenQueryThrowsException() { // Returns mpl for any arguments var c = new Mock <IGregClient>(); c.Setup(x => x.ExecuteAndDeserializeWithContent <List <PackageHeader> >(It.IsAny <HeaderCollectionDownload>())) .Throws(new Exception("Fail!")); var m = new PackageManagerClient(c.Object, MockMaker.Empty <IPackageUploadBuilder>()); var pl = m.ListAll(); Assert.AreEqual(0, pl.Count()); }
public void ListAll_ReturnsNonEmptyListWhenPackagesAreAvailable() { // Returned content var mpl = new ResponseWithContentBody<List<PackageHeader>> { content = new List<PackageHeader>() { new PackageHeader() }, success = true }; // Returns mpl for any arguments var c = new Mock<IGregClient>(); c.Setup(x => x.ExecuteAndDeserializeWithContent<List<PackageHeader>>(It.IsAny<HeaderCollectionDownload>())) .Returns(mpl); var m = new PackageManagerClient(c.Object, MockMaker.Empty<IPackageUploadBuilder>(), ""); var pl = m.ListAll(); Assert.AreNotEqual(0, pl.Count()); }