コード例 #1
0
        public void TestReportingProgressCancellationServiceTest_ContinueFalseWhenProgressNotCanceledAndNoeErrorExist()
        {
            var progressService = new Mock <IProgressService>();

            progressService.SetupGet(x => x.ProgressCanceled).Returns(false);
            SyncServiceFactory.RegisterService(progressService.Object);

            var infoStorageService = new Mock <IInfoStorageService>();

            infoStorageService.SetupGet(x => x.UserInformation).
            Returns(new InfoCollection <IUserInformation>()
            {
                new UserInformation()
                {
                    Type = UserInformationType.Warning
                }
            });

            SyncServiceFactory.RegisterService(infoStorageService.Object);
            var cancelTrueServiceInstance = new TestReportingProgressCancellationService(true);

            var shouldContinue = cancelTrueServiceInstance.CheckIfContinue();

            Assert.AreEqual(shouldContinue, true);
        }
コード例 #2
0
        /// <summary>
        /// Method initializes the assembly.
        /// </summary>
        public void Init()
        {
            SyncServiceFactory.RegisterService <IInfoStorageService>(new InfoStorageService());
            var confService = new ConfigurationService();

            SyncServiceFactory.RegisterService <IConfigurationService>(confService);
            SyncServiceFactory.RegisterService <IProgressService>(new ProgressService());
            var systemVariableService = new SystemVariableService();

            SyncServiceFactory.RegisterService <ISystemVariableService>(systemVariableService);
            SyncServiceFactory.RegisterService <IWorkItemSyncService>(new WorkItemSyncService(systemVariableService));
        }
コード例 #3
0
        public void TestReportingProgressCancellationServiceTest_ContinueFalseWhenProgressCanceledTrue()
        {
            //Arrange
            var progressService = new Mock <IProgressService>();

            progressService.SetupGet(x => x.ProgressCanceled).Returns(true);
            SyncServiceFactory.RegisterService(progressService.Object);
            var infoStorageService = new Mock <IInfoStorageService>();

            SyncServiceFactory.RegisterService(infoStorageService.Object);
            var cancelTrueServiceInstance = new TestReportingProgressCancellationService(true);

            //Act
            var shouldContinue = cancelTrueServiceInstance.CheckIfContinue();

            Assert.AreEqual(shouldContinue, false);
        }
コード例 #4
0
ファイル: AssemblyInit.cs プロジェクト: qanh96/WordToTFS
 /// <summary>
 /// Method initializes the assembly.
 /// </summary>
 public void Init()
 {
     SyncServiceFactory.RegisterService <IWord2007AdapterCreator>(new AdapterCreator());
 }
コード例 #5
0
ファイル: AssemblyInit.cs プロジェクト: qanh96/WordToTFS
 /// <summary>
 /// Method initializes the assembly.
 /// </summary>
 public void Init()
 {
     SyncServiceFactory.RegisterService <ITeamFoundationServerMaintenance>(
         new TeamFoundationServerMaintenance2010());
     SyncServiceFactory.RegisterService <ITfsAdapterCreator>(new AdapterCreator());
 }