public void UpdateSolutionListenerConstructorTest() { IServiceProvider serviceProvider = this.PrepareServiceProvider(); UpdateSolutionListener_Accessor target = new UpdateSolutionListener_Accessor(serviceProvider); Assert.IsNotNull(target); }
public void UpdateSolution_CancelTest() { IServiceProvider serviceProvider = this.PrepareServiceProvider(); UpdateSolutionListener_Accessor target = new UpdateSolutionListener_Accessor(serviceProvider); int expected = VSConstants.E_NOTIMPL; int actual; actual = target.UpdateSolution_Cancel(); Assert.AreEqual(expected, actual); }
public void OnActiveProjectCfgChangeTest() { IServiceProvider serviceProvider = this.PrepareServiceProvider(); UpdateSolutionListener_Accessor target = new UpdateSolutionListener_Accessor(serviceProvider); int expected = VSConstants.E_NOTIMPL; int actual = target.OnActiveProjectCfgChange(null); Assert.AreEqual(expected, actual); }
public void UpdateSolution_DoneTest() { IServiceProvider serviceProvider = this.PrepareServiceProvider(); UpdateSolutionListener_Accessor target = new UpdateSolutionListener_Accessor(serviceProvider); int fSucceeded = 0; int fModified = 0; int fCancelCommand = 0; int expected = VSConstants.E_NOTIMPL; int actual = target.UpdateSolution_Done(fSucceeded, fModified, fCancelCommand); Assert.AreEqual(expected, actual); }
public void InitializeTest() { var serviceProvider = new MockServiceProvider(); UpdateSolutionListener_Accessor target = new UpdateSolutionListener_Accessor(serviceProvider); target.Initialize(); uint expected = 1; Assert.AreEqual(expected, target.eventsCookie); }
public void VsUpdateSolution_BeginTest() { IServiceProvider serviceProvider = this.PrepareServiceProvider(); UpdateSolutionListener_Accessor target = new UpdateSolutionListener_Accessor(serviceProvider); int pfCancelUpdate = 0; int pfCancelUpdateExpected = 0; int expected = VSConstants.E_NOTIMPL; int actual = target.UpdateSolution_Begin(ref pfCancelUpdate); Assert.AreEqual(pfCancelUpdateExpected, pfCancelUpdate); Assert.AreEqual(expected, actual); }
public void UpdateSolution_StartUpdateTest() { IServiceProvider serviceProvider = this.PrepareServiceProvider(); UpdateSolutionListener_Accessor target = new UpdateSolutionListener_Accessor(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"); }
public void DisposeTest() { var serviceProvider = new MockServiceProvider(); var mockUpdateSolutionEvents = new Mock <IVsUpdateSolutionEvents>(); UpdateSolutionListener_Accessor target = new UpdateSolutionListener_Accessor(serviceProvider); uint cookie = 0; ((IVsSolutionBuildManager)serviceProvider.GetService(typeof(SVsSolutionBuildManager))).AdviseUpdateSolutionEvents(mockUpdateSolutionEvents.Instance as IVsUpdateSolutionEvents, out cookie); Debug.Assert(cookie == 1); bool disposing = true; target.eventsCookie = cookie; target.Dispose(disposing); }
public void DisposeTest() { var serviceProvider = new MockServiceProvider(); var mockUpdateSolutionEvents = new Mock<IVsUpdateSolutionEvents>(); UpdateSolutionListener_Accessor target = new UpdateSolutionListener_Accessor(serviceProvider); uint cookie = 0; ((IVsSolutionBuildManager)serviceProvider.GetService(typeof(SVsSolutionBuildManager))).AdviseUpdateSolutionEvents(mockUpdateSolutionEvents.Instance as IVsUpdateSolutionEvents, out cookie); Debug.Assert(cookie == 1); bool disposing = true; target.eventsCookie = cookie; target.Dispose(disposing); }