コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }