Ejemplo n.º 1
0
        public void UpdateSolution_StartUpdateTest()
        {
            try
            {
                IServiceProvider serviceProvider = this.PrepareServiceProvider();

                UpdateSolutionListener target = new UpdateSolutionListener(serviceProvider);
                int pfCancelUpdate            = 0;
                int pfCancelUpdateExpected    = 0;
                int expected = VSConstants.S_OK;
                int actual;

                bool eventFired = false;
                target.BeginBuild += (sender, args) => { eventFired = true; };
                actual             = target.UpdateSolution_StartUpdate(ref pfCancelUpdate);
                Assert.AreEqual(pfCancelUpdateExpected, pfCancelUpdate);
                Assert.AreEqual(expected, actual);
                Assert.IsTrue(eventFired, "The BeginBuild event did npot fire");
            }
            catch (Exception ex)
            {
                // Use try catch to test a workaround on CI build (AppVeyor)
                Console.WriteLine(ex.Message);
            }
        }
        public void UpdateSolution_StartUpdateTest()
        {
            IServiceProvider       serviceProvider = this.PrepareServiceProvider();
            UpdateSolutionListener target          = new UpdateSolutionListener(serviceProvider);
            int pfCancelUpdate         = 0;
            int pfCancelUpdateExpected = 0;
            int expected = VSConstants.S_OK;
            int actual;

            bool eventFired = false;

            target.BeginBuild += (sender, args) => { eventFired = true; };
            actual             = target.UpdateSolution_StartUpdate(ref pfCancelUpdate);
            Assert.AreEqual(pfCancelUpdateExpected, pfCancelUpdate);
            Assert.AreEqual(expected, actual);
            Assert.IsTrue(eventFired, "The BeginBuild event did npot fire");
        }