public void NewPackageVersionUpload_DoesNotThrowExceptionWhenDLLIsLoadedSeveralTimes() { string packagesDirectory = Path.Combine(TestDirectory, "pkgs"); var pathManager = new Mock <Dynamo.Interfaces.IPathManager>(); pathManager.SetupGet(x => x.PackagesDirectories).Returns(() => new List <string> { packagesDirectory }); var loader = new PackageLoader(pathManager.Object); loader.LoadAll(new LoadPackageParams { Preferences = ViewModel.Model.PreferenceSettings }); PublishPackageViewModel vm = null; var package = loader.LocalPackages.FirstOrDefault(x => x.Name == "Custom Rounding"); Assert.DoesNotThrow(() => { vm = PublishPackageViewModel.FromLocalPackage(ViewModel, package); }); Assert.AreEqual(PackageUploadHandle.State.Error, vm.UploadState); }
private void PublishNewPackage(bool isTestMode) { Model.RefreshCustomNodesFromDirectory(dynamoViewModel.Model.CustomNodeManager, isTestMode); var vm = PublishPackageViewModel.FromLocalPackage(dynamoViewModel, Model); vm.IsNewVersion = false; dynamoViewModel.OnRequestPackagePublishDialog(vm); }
private void PublishNewPackageVersion() { this.Model.RefreshCustomNodesFromDirectory(this.dynamoViewModel.Model.CustomNodeManager); var vm = PublishPackageViewModel.FromLocalPackage(dynamoViewModel, this.Model); vm.IsNewVersion = true; dynamoViewModel.OnRequestPackagePublishDialog(vm); }
public void NewPackageVersionUpload_DoesNotThrowExceptionWhenDLLIsLoadedSeveralTimes() { string packagesDirectory = Path.Combine(TestDirectory, "pkgs"); var loader = new PackageLoader(packagesDirectory); loader.LoadAll(new LoadPackageParams { Preferences = ViewModel.Model.PreferenceSettings }); PublishPackageViewModel vm = null; Assert.DoesNotThrow(() => { vm = PublishPackageViewModel.FromLocalPackage(ViewModel, loader.LocalPackages.First()); }); Assert.AreEqual(PackageUploadHandle.State.Error, vm.UploadState); }