Ejemplo n.º 1
0
        public void StartSolutionRestore_WithValidProjectName_FiresProjectUpdateEvent()
        {
            var restoreProgressEvents = new VsRestoreProgressEvents(_packageProjectProvider.Object, new Mock <INuGetTelemetryProvider>().Object);

            var expectedProjectList = new List <string>()
            {
                "projectName.csproj"
            };

            IReadOnlyList <string> actualProjectList = null;

            restoreProgressEvents.SolutionRestoreStarted += (updatedFiles) =>
            {
                actualProjectList = updatedFiles;
            };

            restoreProgressEvents.StartSolutionRestore(expectedProjectList);

            Assert.Equal(expectedProjectList, actualProjectList);
        }
        public void StartSolutionRestore_WithValidProjectName_FiresProjectUpdateEvent()
        {
            var restoreProgressEvents = new VsRestoreProgressEvents();

            var expectedProjectList = new List <string>()
            {
                "projectName.csproj"
            };

            IReadOnlyList <string> actualProjectList = null;

            restoreProgressEvents.SolutionRestoreStarted += (updatedFiles) =>
            {
                actualProjectList = updatedFiles;
            };

            restoreProgressEvents.StartSolutionRestore(expectedProjectList);

            Assert.Equal(expectedProjectList, actualProjectList);
        }
        public void StartSolutionRestore_WithEmptyProjectList_ThrowsArgumentException()
        {
            var restoreProgressEvents = new VsRestoreProgressEvents();

            Assert.Throws <ArgumentException>(() => restoreProgressEvents.StartSolutionRestore(new List <string>()));
        }
        public void StartSolutionRestore_WithNullProjectList_ThrowsArgumentException()
        {
            var restoreProgressEvents = new VsRestoreProgressEvents();

            Assert.Throws <ArgumentException>(() => restoreProgressEvents.StartSolutionRestore(null));
        }
Ejemplo n.º 5
0
        public void StartSolutionRestore_WithEmptyProjectList_ThrowsArgumentException()
        {
            var restoreProgressEvents = new VsRestoreProgressEvents(_packageProjectProvider.Object, new Mock <INuGetTelemetryProvider>().Object);

            Assert.Throws <ArgumentException>(() => restoreProgressEvents.StartSolutionRestore(new List <string>()));
        }