public void Undeprecate_ReturnsFailureObjectWhenRequestThrowsException() { var gc = new Mock <IGregClient>(); gc.Setup(x => x.ExecuteAndDeserialize(It.IsAny <Undeprecate>())).Throws(new Exception()); var pc = new PackageManagerClient(gc.Object, MockMaker.Empty <IPackageUploadBuilder>()); var res = pc.Undeprecate("id"); Assert.IsFalse(res.Success); }
private void Undeprecate() { var res = MessageBox.Show(String.Format(Resources.MessageToUndeprecatePackage, this.Model.Name), Resources.UndeprecatingPackageMessageBoxTitle, MessageBoxButton.YesNo, MessageBoxImage.Question); if (res == MessageBoxResult.No) { return; } packageManagerClient.Undeprecate(Model.Name); }
public void Undeprecate_ReturnsFailureObjectWhenRequestFails() { var gc = new Mock <IGregClient>(); gc.Setup(x => x.ExecuteAndDeserialize(It.IsAny <Undeprecate>())).Returns(new ResponseBody() { success = false // set to false }); var pc = new PackageManagerClient(gc.Object, MockMaker.Empty <IPackageUploadBuilder>()); var res = pc.Undeprecate("id"); Assert.IsFalse(res.Success); }
public void Undeprecate_ReturnsFailureObjectWhenRequestThrowsException() { var gc = new Mock<IGregClient>(); gc.Setup(x => x.ExecuteAndDeserialize(It.IsAny<Undeprecate>())).Throws(new Exception()); var pc = new PackageManagerClient(gc.Object, MockMaker.Empty<IPackageUploadBuilder>(), ""); var res = pc.Undeprecate("id"); Assert.IsFalse(res.Success); }
public void Undeprecate_ReturnsFailureObjectWhenRequestFails() { var gc = new Mock<IGregClient>(); gc.Setup(x => x.ExecuteAndDeserialize(It.IsAny<Undeprecate>())).Returns(new ResponseBody() { success = false // set to false }); var pc = new PackageManagerClient(gc.Object, MockMaker.Empty<IPackageUploadBuilder>(), ""); var res = pc.Undeprecate("id"); Assert.IsFalse(res.Success); }