diff --git a/src/DynamoCoreWpf/ViewModels/PackageManager/PublishPackageViewModel.cs b/src/DynamoCoreWpf/ViewModels/PackageManager/PublishPackageViewModel.cs index 890989f359c..ba4a150e64a 100644 --- a/src/DynamoCoreWpf/ViewModels/PackageManager/PublishPackageViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/PackageManager/PublishPackageViewModel.cs @@ -92,7 +92,7 @@ public DynamoViewModel DynamoViewModel /// /// Package Publish entry, binded to the host multi-selection option /// - public class HostComboboxEntry : NotificationObject + public class HostComboboxEntry : NotificationObject { /// /// Name of the host @@ -211,7 +211,7 @@ public bool IsNewVersion } } } - + /// /// CanEditName property /// @@ -610,8 +610,8 @@ public List SelectedHosts } // Format string since it will be displayed SelectedHostsString = SelectedHostsString.Trim().TrimEnd(','); - RaisePropertyChanged( nameof(SelectedHosts)); - RaisePropertyChanged( nameof(SelectedHostsString)); + RaisePropertyChanged(nameof(SelectedHosts)); + RaisePropertyChanged(nameof(SelectedHostsString)); RaisePropertyChanged(nameof(HasChanges)); } } @@ -807,7 +807,7 @@ public string DependencyNames get => dependencyNames; set { - dependencyNames = value; + dependencyNames = value; RaisePropertyChanged(nameof(DependencyNames)); RaisePropertyChanged(nameof(HasChanges)); } @@ -884,7 +884,7 @@ public bool RetainFolderStructureOverride } set { - if(_retainFolderStructureOverride != value) + if (_retainFolderStructureOverride != value) { _retainFolderStructureOverride = value; RaisePropertyChanged(nameof(RetainFolderStructureOverride)); @@ -911,7 +911,7 @@ private static MetadataLoadContext SharedPublishLoadContext { sharedMetaDataLoadContext = sharedMetaDataLoadContext == null || sharedMetaDataLoadContext.CoreAssembly == null ? PackageLoader.InitSharedPublishLoadContext() : sharedMetaDataLoadContext; } - catch (ObjectDisposedException) + catch (ObjectDisposedException) { // This can happen if the shared context has been disposed before. // In this case, we create a new one. @@ -950,7 +950,7 @@ public bool HasChanges private bool IsPublishFromLocalPackage = false; #endregion - + internal PublishPackageViewModel() { customNodeDefinitions = new List(); @@ -974,7 +974,7 @@ internal PublishPackageViewModel() } private void DependenciesOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) => RefreshDependencyNames(); - + private void RefreshDependencyNames() { if (Dependencies.Count < 1) @@ -989,7 +989,7 @@ private void RefreshDependencyNames() private void RefreshPackageContents() { PackageContents.Clear(); - + var itemsToAdd = CustomNodeDefinitions .Select(def => new PackageItemRootViewModel(def)) .Concat(Assemblies.Select((pa) => new PackageItemRootViewModel(pa))) @@ -1049,7 +1049,7 @@ private bool IsDuplicateFile(PackageItemRootViewModel item1, PackageItemRootView case DependencyType.CustomNode: default: return false; - } + } } /// @@ -1061,7 +1061,7 @@ internal List BindParentToChild(Dictionary /// The class constructor. - public PublishPackageViewModel( DynamoViewModel dynamoViewModel ) : this() + public PublishPackageViewModel(DynamoViewModel dynamoViewModel) : this() { this.dynamoViewModel = dynamoViewModel; KnownHosts = initializeHostSelections(); @@ -1292,7 +1292,7 @@ private void ClearAllEntries() this.AdditionalFiles = new ObservableCollection(); this.Dependencies = new ObservableCollection(); this.Assemblies = new List(); - this.SelectedHostsString = string.Empty; + this.SelectedHostsString = string.Empty; this.SelectedHosts = new List(); this.copyrightHolder = string.Empty; this.copyrightYear = string.Empty; @@ -1307,28 +1307,28 @@ private void ClearAllEntries() /// /// true if any changes have been made, otherwise false internal bool AnyUserChanges() - { - if(!String.IsNullOrEmpty(this.Name)) return true; - if(!String.IsNullOrEmpty(this.RepositoryUrl)) return true; - if(!String.IsNullOrEmpty(this.SiteUrl)) return true; - if(!String.IsNullOrEmpty(this.License)) return true; - if(!String.IsNullOrEmpty(this.Keywords)) return true; - if(!String.IsNullOrEmpty(this.Description)) return true; - if(!String.IsNullOrEmpty(this.Group)) return true; - if(!String.IsNullOrEmpty(this.MajorVersion) && !(this.MajorVersion.Equals("0"))) return true; - if(!String.IsNullOrEmpty(this.MinorVersion) && !(this.MinorVersion.Equals("0"))) return true; - if(!String.IsNullOrEmpty(this.BuildVersion) && !(this.BuildVersion.Equals("0"))) return true; - if(this.AdditionalFiles.Any()) return true; - if(this.Dependencies.Any()) return true; - if(this.Assemblies.Any()) return true; - if(this.SelectedHosts.Any()) return true; - if(!String.IsNullOrEmpty(this.SelectedHostsString)) return true; - if(!String.IsNullOrEmpty(this.copyrightHolder)) return true; - if(!String.IsNullOrEmpty(this.copyrightYear)) return true; - if(!String.IsNullOrEmpty(this.RootFolder)) return true; + { + if (!String.IsNullOrEmpty(this.Name)) return true; + if (!String.IsNullOrEmpty(this.RepositoryUrl)) return true; + if (!String.IsNullOrEmpty(this.SiteUrl)) return true; + if (!String.IsNullOrEmpty(this.License)) return true; + if (!String.IsNullOrEmpty(this.Keywords)) return true; + if (!String.IsNullOrEmpty(this.Description)) return true; + if (!String.IsNullOrEmpty(this.Group)) return true; + if (!String.IsNullOrEmpty(this.MajorVersion) && !(this.MajorVersion.Equals("0"))) return true; + if (!String.IsNullOrEmpty(this.MinorVersion) && !(this.MinorVersion.Equals("0"))) return true; + if (!String.IsNullOrEmpty(this.BuildVersion) && !(this.BuildVersion.Equals("0"))) return true; + if (this.AdditionalFiles.Any()) return true; + if (this.Dependencies.Any()) return true; + if (this.Assemblies.Any()) return true; + if (this.SelectedHosts.Any()) return true; + if (!String.IsNullOrEmpty(this.SelectedHostsString)) return true; + if (!String.IsNullOrEmpty(this.copyrightHolder)) return true; + if (!String.IsNullOrEmpty(this.copyrightYear)) return true; + if (!String.IsNullOrEmpty(this.RootFolder)) return true; return false; - } + } private void ClearPackageContents() { @@ -1356,8 +1356,8 @@ private void ClearPackageContents() this.CustomDyfFilepaths.Clear(); RaisePropertyChanged(nameof(CustomDyfFilepaths)); } - - this.CustomNodeDefinitions = new List(); + + this.CustomNodeDefinitions = new List(); } private void ThisPropertyChanged(object sender, PropertyChangedEventArgs e) @@ -1365,8 +1365,8 @@ private void ThisPropertyChanged(object sender, PropertyChangedEventArgs e) if (e.PropertyName == "PackageContents") { CanSubmit(); - SubmitCommand.RaiseCanExecuteChanged(); - PublishLocallyCommand.RaiseCanExecuteChanged(); + SubmitCommand.RaiseCanExecuteChanged(); + PublishLocallyCommand.RaiseCanExecuteChanged(); } } @@ -1374,7 +1374,7 @@ private bool CanSetKeywords() { return KeywordList.Count() > 0; } - + private void SetKeywords() { KeywordsCollection = KeywordList.Select(x => new KeywordTag(x)).ToObservableCollection(); @@ -1501,6 +1501,7 @@ public static PublishPackageViewModel FromLocalPackage(DynamoViewModel dynamoVie internal static PublishPackageViewModel FromLocalPackage(DynamoViewModel dynamoViewModel, Package pkg, bool retainFolderStructure) { var defs = new List(); + var defPreviews = new Dictionary(); foreach (var x in pkg.LoadedCustomNodes) { @@ -1511,6 +1512,7 @@ internal static PublishPackageViewModel FromLocalPackage(DynamoViewModel dynamoV out def)) { defs.Add(def); + defPreviews[x.Name] = x.Path; } } @@ -1520,6 +1522,7 @@ internal static PublishPackageViewModel FromLocalPackage(DynamoViewModel dynamoV Description = pkg.Description, Keywords = pkg.Keywords != null ? String.Join(" ", pkg.Keywords) : string.Empty, CustomNodeDefinitions = defs, + CustomDyfFilepaths = defPreviews, Name = pkg.Name, RepositoryUrl = pkg.RepositoryUrl ?? string.Empty, SiteUrl = pkg.SiteUrl ?? string.Empty, @@ -1547,7 +1550,7 @@ internal static PublishPackageViewModel FromLocalPackage(DynamoViewModel dynamoV foreach (var file in pkg.EnumerateAssemblyFilesInPackage()) { Assembly assem; - var result = PackageLoader.TryMetaDataContextLoad(pkg.RootDirectory , file, SharedPublishLoadContext, out assem); + var result = PackageLoader.TryMetaDataContextLoad(pkg.RootDirectory, file, SharedPublishLoadContext, out assem); switch (result) { @@ -1633,7 +1636,7 @@ internal static PackageAssembly GetPackageAssembly(IEnumerable nodeLibra public void OnPublishSuccess() { if (PublishSuccess != null) - PublishSuccess(this); + PublishSuccess(this); } private void UploadHandleOnPropertyChanged(object sender, PropertyChangedEventArgs propertyChangedEventArgs) @@ -1650,7 +1653,7 @@ private void UploadHandleOnPropertyChanged(object sender, PropertyChangedEventAr ClearAllEntries(); }); } - + } else if (propertyChangedEventArgs.PropertyName == nameof(PackageUploadHandle.ErrorString)) { @@ -1741,7 +1744,7 @@ internal IEnumerable GetAllFiles() // make sure workspaces are saved var unsavedWorkspaceNames = - workspaces.Where(ws => ws.HasUnsavedChanges || ws.FileName == null).Select( ws => ws.Name).ToList(); + workspaces.Where(ws => ws.HasUnsavedChanges || ws.FileName == null).Select(ws => ws.Name).ToList(); if (unsavedWorkspaceNames.Any()) { if (!DynamoModel.IsTestMode) MessageBoxService.Show(System.Windows.Application.Current?.MainWindow, Resources.MessageUnsavedChanges0, Resources.UnsavedChangesMessageBoxTitle, MessageBoxButton.OK, MessageBoxImage.Warning); @@ -1766,7 +1769,7 @@ internal IEnumerable GetAllFiles() // otherwise we need to delete duplicate assemblies which will end up in the same `dll` folder files = RetainFolderStructureOverride && !IsPublishFromLocalPackage ? files.Union(Assemblies.Select(x => x.LocalFilePath)) : - files.Union(Assemblies.Select(x => x.Assembly.Location)); + files.Union(Assemblies.Select(x => x.Assembly.Location)); return files; } @@ -1890,7 +1893,7 @@ public string ErrorString get { return _errorString; } set { - _errorString = value; + _errorString = value; RaisePropertyChanged("ErrorString"); } } @@ -1914,7 +1917,7 @@ private void ShowAddFileDialogAndAdd() var fi = new FileInfo(currentFileName); fDialog.CustomPlaces.Add(fi.DirectoryName); } - + // add the definitions directory to shortcuts as well var pathManager = dynamoViewModel.Model.PathManager; if (Directory.Exists(pathManager.DefaultUserDefinitions)) @@ -2041,11 +2044,11 @@ private void SelectMarkdownDirectory() /// /// Removes an item from the package contents list. /// - private void RemoveItem (object parameter) + private void RemoveItem(object parameter) { if (!(parameter is PackageItemRootViewModel packageItemRootViewModel)) return; - RemoveItemRecursively(packageItemRootViewModel); + RemoveItemRecursively(packageItemRootViewModel); RefreshPackageContents(); RaisePropertyChanged(nameof(PackageContents)); RaisePropertyChanged(nameof(PreviewPackageContents)); @@ -2057,7 +2060,7 @@ private void RemoveItem (object parameter) /// The Cancel command to clear all package data and user interface /// private void Cancel() - { + { this.ClearAllEntries(); } @@ -2089,7 +2092,7 @@ private void RemoveSingleItem(PackageItemRootViewModel vm, DependencyType fileTy if (fileType.Equals(DependencyType.Assembly)) { Assemblies.Remove(Assemblies - .First(x => x.Name == fileName)); + .First(x => x.Name == fileName)); } else if (fileName.ToLower().EndsWith(".dll")) { @@ -2107,7 +2110,7 @@ private void RemoveSingleItem(PackageItemRootViewModel vm, DependencyType fileTy var keyToRemove = CustomDyfFilepaths.Keys .FirstOrDefault(k => Path.GetFileNameWithoutExtension(k) == fileName); - if(keyToRemove != null) CustomDyfFilepaths.Remove(keyToRemove); + if (keyToRemove != null) CustomDyfFilepaths.Remove(keyToRemove); } else { @@ -2155,12 +2158,12 @@ private void AddCustomNodeFile(string filename) // and start publishing with the new copied file. // Since the loadedworkspace node info location is update, the issue is fixed. - foreach(var node in dynamoViewModel.Model.CustomNodeManager.LoadedWorkspaces) + foreach (var node in dynamoViewModel.Model.CustomNodeManager.LoadedWorkspaces) { - if(node.CustomNodeId == dynamoViewModel.Model.CustomNodeManager.GuidFromPath(filename)) + if (node.CustomNodeId == dynamoViewModel.Model.CustomNodeManager.GuidFromPath(filename)) { var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(filename); - node.SetInfo(fileNameWithoutExtension,null,null,filename); + node.SetInfo(fileNameWithoutExtension, null, null, filename); } } @@ -2208,10 +2211,10 @@ private void AddDllFile(string filename) // as the existing assembly cannot be modified while Dynamo is active. if (!this.RetainFolderStructureOverride && this.Assemblies.Any(x => assemName == x.Assembly.GetName().Name) && !duplicateAssemblyWarningTriggered) { - MessageBoxService.Show(Owner, string.Format(Resources.PackageDuplicateAssemblyWarning, + MessageBoxService.Show(Owner, string.Format(Resources.PackageDuplicateAssemblyWarning, dynamoViewModel.BrandingResourceProvider.ProductName), - Resources.PackageDuplicateAssemblyWarningTitle, - MessageBoxButton.OK, + Resources.PackageDuplicateAssemblyWarningTitle, + MessageBoxButton.OK, MessageBoxImage.Stop); duplicateAssemblyWarningTriggered = true; return; @@ -2227,7 +2230,7 @@ private void AddDllFile(string filename) else { AddAdditionalFile(filename); - } + } } catch (Exception e) { @@ -2331,7 +2334,7 @@ private void PublishLocally() // This is caused by the package file is not existed or it has already been in a package. // files.Count() is also checking for the exception that was caught in BuildPackage(). // The scenario can be user trying to publish unsaved workspace. - if (files == null || files.Count() < 1 || unqualifiedFiles.Count() > 0) + if (files == null || files.Count() < 1 || unqualifiedFiles.Count() > 0) { string filesCannotBePublished = null; foreach (var file in unqualifiedFiles) @@ -2467,9 +2470,9 @@ internal IEnumerable BuildPackage() Package.HostDependencies = Enumerable.Empty(); Package.HostDependencies = SelectedHosts; - foreach (string py in GetPythonDependency()) + foreach (string py in GetPythonDependency()) { - if (!Package.HostDependencies.Contains(py)) + if (!Package.HostDependencies.Contains(py)) { Package.HostDependencies = Package.HostDependencies.Concat(new[] { py }); } @@ -2497,7 +2500,7 @@ internal IEnumerable BuildPackage() Package?.LoadState.SetAsError(ErrorString); } - return new string[] {}; + return new string[] { }; } private bool IsDirectoryWritable(string dirPath, bool throwIfFails = false) @@ -2593,7 +2596,7 @@ private bool CanSubmit() // be active when there is no authenticator if (dynamoViewModel == null || !dynamoViewModel.Model.AuthenticationManager.HasAuthProvider) { - ErrorString = string.Format(Resources.CannotSubmitPackage,dynamoViewModel.BrandingResourceProvider.ProductName); + ErrorString = string.Format(Resources.CannotSubmitPackage, dynamoViewModel.BrandingResourceProvider.ProductName); return false; } @@ -2622,7 +2625,7 @@ private bool CheckPackageValidity() IsWarningEnabled = false; } - if(Name.Length <= 0 && !PackageContents.Any()) + if (Name.Length <= 0 && !PackageContents.Any()) { ErrorString = Resources.PackageManagerProvidePackageNameAndFiles; return false; @@ -2706,7 +2709,7 @@ internal void EnableInvalidNameWarningState(string warningMessage) CurrentWarningMessage = warningMessage; IsWarningEnabled = true; } - + private void PreviewPackageBuild() { if (PreviewPackageContents == null) PreviewPackageContents = new ObservableCollection(); @@ -2737,7 +2740,7 @@ private void PreviewPackageBuild() // Removes duplicate file names, retaining only the first encounter file path for each unique file name files = files.GroupBy(file => Path.GetFileName(file), StringComparer.OrdinalIgnoreCase) - .Select(group => group.First()) + .Select(group => group.First()) .ToList(); try { @@ -2746,7 +2749,7 @@ private void PreviewPackageBuild() var rootItemPreview = RetainFolderStructureOverride ? GetExistingRootItemViewModel(publishPath, packageName) : GetPreBuildRootItemViewModel(publishPath, packageName, files); - + PreviewPackageContents.Add(rootItemPreview); RaisePropertyChanged(nameof(PreviewPackageContents)); @@ -2765,7 +2768,7 @@ internal PackageItemRootViewModel GetExistingRootItemViewModel(string publishPat if (PackageContents.Count(x => x.DependencyType.Equals(DependencyType.Folder)) == 1) { // If there is only one root item, this root item becomes the new folder var item = PackageContents.First(x => x.DependencyType.Equals(DependencyType.Folder)); - + item = new PackageItemRootViewModel(Path.Combine(publishPath, packageName)); item.AddChildren( PackageContents.First().ChildItems.ToList() ); @@ -2774,7 +2777,7 @@ internal PackageItemRootViewModel GetExistingRootItemViewModel(string publishPat // It means we have more than 1 root item, in which case we need to combine them var rootItem = new PackageItemRootViewModel(Path.Combine(publishPath, packageName)); - foreach(var item in PackageContents) + foreach (var item in PackageContents) { // Skip 'bare' custom nodes, they will be represented by their CustomNodePreview counterparts if(item.DependencyType.Equals(DependencyType.CustomNode)) { continue; } @@ -2817,11 +2820,11 @@ internal PackageItemRootViewModel GetPreBuildRootItemViewModel(string publishPat else if (file.ToLower().EndsWith(".dll") || PackageDirectoryBuilder.IsXmlDocFile(file, files) || PackageDirectoryBuilder.IsDynamoCustomizationFile(file, files)) { // Assemblies carry the information if they are NodeLibrary or not - if(Assemblies.Any(x => x.Name.Equals(Path.GetFileNameWithoutExtension(fileName)))) + if (Assemblies.Any(x => x.Name.Equals(Path.GetFileNameWithoutExtension(fileName)))) { var packageContents = PackageItemRootViewModel.GetFiles(PackageContents.ToList()); var dll = packageContents.First(x => x.DependencyType.Equals(DependencyType.Assembly) && x.DisplayName.Equals(Path.GetFileNameWithoutExtension(fileName))); - if(dll != null) + if (dll != null) binItemPreview.AddChildren(dll); } else @@ -2837,7 +2840,7 @@ internal PackageItemRootViewModel GetPreBuildRootItemViewModel(string publishPat } } - foreach(var docFile in MarkdownFiles) + foreach (var docFile in MarkdownFiles) { var fileName = Path.GetFileName(docFile); var doc = new PackageItemRootViewModel(new FileInfo(Path.Combine(docDir, fileName))); diff --git a/src/DynamoPackages/Package.cs b/src/DynamoPackages/Package.cs index ecbe62c7fa7..196dac48be9 100644 --- a/src/DynamoPackages/Package.cs +++ b/src/DynamoPackages/Package.cs @@ -293,6 +293,8 @@ public static Package FromJson(string headerPath, ILogger logger) } + //TODO: why are we skipping backup files and folders, any particular reason? + //TODO: can we remove the part where we skip the original pkg.json file? This is handled later anyways public void EnumerateAdditionalFiles() { if (String.IsNullOrEmpty(RootDirectory) || !Directory.Exists(RootDirectory)) return; @@ -303,8 +305,9 @@ public void EnumerateAdditionalFiles() RootDirectory, "*", SearchOption.AllDirectories) - .Where(x => !x.ToLower().EndsWith(".dyf") && !x.ToLower().EndsWith(".dll") && - !x.ToLower().EndsWith("pkg.json") && !x.ToLower().EndsWith(".backup") && + .Where(x => !x.ToLower().EndsWith(".dyf") && !x.ToLower().EndsWith(".dll") + //&& !x.ToLower().EndsWith("pkg.json") + && !x.ToLower().EndsWith(".backup") && !x.ToLower().Contains(backupFolderName)) .Select(x => new PackageFileInfo(RootDirectory, x)); diff --git a/src/DynamoPackages/PackageDirectoryBuilder.cs b/src/DynamoPackages/PackageDirectoryBuilder.cs index 5e1a69ec73e..7ccd0e6ad1f 100644 --- a/src/DynamoPackages/PackageDirectoryBuilder.cs +++ b/src/DynamoPackages/PackageDirectoryBuilder.cs @@ -37,7 +37,7 @@ internal class PackageDirectoryBuilder : IPackageDirectoryBuilder /// /// For moving files around /// For modifying custom node paths - internal PackageDirectoryBuilder(IFileSystem fileSystem, IPathRemapper pathRemapper) + internal PackageDirectoryBuilder(IFileSystem fileSystem, IPathRemapper pathRemapper) { this.fileSystem = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem)); this.pathRemapper = pathRemapper ?? throw new ArgumentNullException(nameof(pathRemapper)); @@ -61,7 +61,7 @@ public IDirectoryInfo BuildDirectory(Package package, string packagesDirectory, WritePackageHeader(package, rootDir); RemoveUnselectedFiles(contentFiles, rootDir); CopyFilesIntoPackageDirectory(contentFiles, markdownFiles, dyfDir, binDir, extraDir, docDir); - RemoveDyfFiles(contentFiles, dyfDir); + RemoveDyfFiles(contentFiles, dyfDir); RemapCustomNodeFilePaths(contentFiles, dyfDir.FullName); @@ -79,7 +79,7 @@ public IDirectoryInfo BuildDirectory(Package package, string packagesDirectory, /// public IDirectoryInfo BuildRetainDirectory(Package package, string packagesDirectory, IEnumerable roots, IEnumerable> contentFiles, IEnumerable markdownFiles) { - + var rootPath = Path.Combine(packagesDirectory, package.Name); var rootDir = fileSystem.TryCreateDirectory(rootPath); package.RootDirectory = rootDir.FullName; @@ -213,9 +213,9 @@ private void RemoveUnselectedFiles(IEnumerable filePaths, IDirectoryInfo } } - private void FormPackageDirectory(string packageDirectory, string packageName, - out IDirectoryInfo root, out IDirectoryInfo dyfDir, - out IDirectoryInfo binDir, out IDirectoryInfo extraDir, + private void FormPackageDirectory(string packageDirectory, string packageName, + out IDirectoryInfo root, out IDirectoryInfo dyfDir, + out IDirectoryInfo binDir, out IDirectoryInfo extraDir, out IDirectoryInfo docDir) { var rootPath = Path.Combine(packageDirectory, packageName); @@ -411,7 +411,6 @@ internal void CopyFilesIntoRetainedPackageDirectory(IEnumerable files, IEnumerab #endregion #region Public Static Utility Methods - + public static bool IsXmlDocFile(string path, IEnumerable files) { if (!path.ToLower().EndsWith(".xml")) return false; diff --git a/test/DynamoCoreWpfTests/PublishPackageViewModelTests.cs b/test/DynamoCoreWpfTests/PublishPackageViewModelTests.cs index edc9dea6185..cc5987d50a7 100644 --- a/test/DynamoCoreWpfTests/PublishPackageViewModelTests.cs +++ b/test/DynamoCoreWpfTests/PublishPackageViewModelTests.cs @@ -119,7 +119,7 @@ public void NewPackageDoesNotThrow_NativeBinaryIsAddedAsAdditionalFile_NotBinary vm = PublishPackageViewModel.FromLocalPackage(ViewModel, package, false); }); - Assert.AreEqual(1, vm.AdditionalFiles.Count); + Assert.AreEqual(2, vm.AdditionalFiles.Count); Assert.AreEqual(0, vm.Assemblies.Count); Assert.AreEqual(PackageUploadHandle.State.Ready, vm.UploadState); @@ -177,10 +177,10 @@ public void NewPackageVersionUpload_CanAddAndRemoveFiles() //since retain is true, we will retain both the (renamed)assembly and the additional file. //the already loaded assembly is added to the additional files list as well vm.AddFile(addFilePath); - Assert.AreEqual(2, vm.AdditionalFiles.Count); + Assert.AreEqual(3, vm.AdditionalFiles.Count); vm.RemoveItemCommand.Execute(pkgItem); - Assert.AreEqual(1, vm.AdditionalFiles.Count); + Assert.AreEqual(2, vm.AdditionalFiles.Count); //arrange node libraries var assem = vm.Assemblies.FirstOrDefault().Assembly;