public void StartProjectUpdate_WithValidProjectName_FiresProjectUpdateEvent()
        {
            var restoreProgressEvents = new VsRestoreProgressEvents();

            var expectedProjectName  = "projectName.csproj";
            var expectedFileListName = new List <string>()
            {
                "project.assets.json"
            };

            string actualProjectName = null;
            IReadOnlyList <string> actualFileListName = null;

            restoreProgressEvents.ProjectUpdateStarted += (projectUniqueName, updatedFiles) =>
            {
                actualProjectName  = projectUniqueName;
                actualFileListName = updatedFiles;
            };

            restoreProgressEvents.StartProjectUpdate(expectedProjectName, expectedFileListName);

            Assert.Equal(expectedProjectName, actualProjectName);
            Assert.Equal(expectedFileListName, actualFileListName);
        }
        public void StartProjectUpdate_WithNullProjectName_ThrowsArgumentNullException()
        {
            var restoreProgressEvents = new VsRestoreProgressEvents();

            Assert.Throws <ArgumentNullException>(() => restoreProgressEvents.StartProjectUpdate(null, new string[] { }));
        }
Exemplo n.º 3
0
        public void StartProjectUpdate_WithNullProjectName_ThrowsArgumentNullException()
        {
            var restoreProgressEvents = new VsRestoreProgressEvents(_packageProjectProvider.Object, new Mock <INuGetTelemetryProvider>().Object);

            Assert.Throws <ArgumentNullException>(() => restoreProgressEvents.StartProjectUpdate(null, new string[] { }));
        }