Beispiel #1
0
        public void Setup()
        {
            this.innovatorUser     = new InnovatorUser();
            this.serverConnection  = Substitute.For <IServerConnection>();
            this.innovatorInstance = new Innovator(this.serverConnection);
            this.iOMWrapper        = Substitute.For <IIOMWrapper>();

            this.authManager   = new AuthenticationManagerProxy(serverConnection, innovatorInstance, innovatorUser, iOMWrapper);
            this.dialogFactory = Substitute.For <IDialogFactory>();
            this.projectConfigurationManager = Substitute.For <IProjectConfigurationManager>();
            this.projectConfiguration        = Substitute.For <IProjectConfiguraiton>();
            this.templateLoader = new TemplateLoader(dialogFactory);
            this.packageManager = new PackageManager(authManager);

            ConnectionInfo testConnectionInfo = new ConnectionInfo()
            {
                LastConnection = true
            };

            this.projectConfiguration.Connections.Returns(new List <ConnectionInfo>()
            {
                testConnectionInfo
            });

            this.openFromArasViewModel = new OpenFromArasViewModel(authManager,
                                                                   dialogFactory,
                                                                   projectConfigurationManager,
                                                                   projectConfiguration,
                                                                   templateLoader,
                                                                   packageManager,
                                                                   "tesPathToProjectConfigFile",
                                                                   "testProjectName",
                                                                   "testProjectFullName",
                                                                   "testProjectLanguage");
        }
 private void LoadIOMWrapper(string projectFullName)
 {
     if (iOMWrapper == null || iOMWrapper.ProjectFullName != projectFullName)
     {
         iOMWrapper = new IOMWrapper(projectFullName);
     }
 }
 private void LoadIOMWrapper(string projectFullName)
 {
     if (iOMWrapper == null || iOMWrapper.ProjectFullName != projectFullName)
     {
         iOMWrapper = new IOMWrapper(messageManager, projectFullName, projectManager.IOMFilePath);
     }
 }
Beispiel #4
0
        public void Setup()
        {
            this.innovatorUser     = new InnovatorUser();
            this.serverConnection  = Substitute.For <IServerConnection>();
            this.innovatorInstance = new Innovator(this.serverConnection);
            this.iOMWrapper        = Substitute.For <IIOMWrapper>();

            this.authManager   = new AuthenticationManagerProxy(serverConnection, innovatorInstance, innovatorUser, iOMWrapper);
            this.dialogFactory = Substitute.For <IDialogFactory>();
            this.projectConfigurationManager = Substitute.For <IProjectConfigurationManager>();
            this.projectConfiguration        = Substitute.For <IProjectConfiguraiton>();
            this.messageManager      = Substitute.For <MessageManager>();
            this.packageManager      = new PackageManager(authManager, messageManager);
            this.arasDataProvider    = Substitute.For <IArasDataProvider>();
            this.methodInformation   = new MethodInfo();
            this.templateLoader      = new TemplateLoader();
            this.projectManager      = Substitute.For <IProjectManager>();
            this.codeProvider        = Substitute.For <ICodeProvider>();
            this.globalConfiguration = Substitute.For <IGlobalConfiguration>();

            this.globalConfiguration.GetUserCodeTemplatesPaths().Returns(new List <string>());

            this.serverConnection.When(x => x.CallAction("ApplyItem", Arg.Is <XmlDocument>(doc => doc.DocumentElement.Attributes["type"].Value == "Value"), Arg.Any <XmlDocument>()))
            .Do(x =>
            {
                (x[2] as XmlDocument).Load(Path.Combine(currentPath, @"Dialogs\ViewModels\TestData\ActionLocationsListValue.xml"));
            });

            this.serverConnection.When(x => x.CallAction("ApplyItem", Arg.Is <XmlDocument>(doc => doc.DocumentElement.Attributes["type"].Value == "Filter Value"), Arg.Any <XmlDocument>()))
            .Do(x =>
            {
                (x[2] as XmlDocument).Load(Path.Combine(currentPath, @"Dialogs\ViewModels\TestData\MethodTypesListFilterValue.xml"));
            });

            this.projectConfiguration.LastSavedSearch.Returns(new Dictionary <string, List <PropertyInfo> >());

            XmlDocument methodItemTypeAML = new XmlDocument();

            methodItemTypeAML.Load(Path.Combine(currentPath, @"Dialogs\ViewModels\TestData\MethodItemType.xml"));

            Item methodItemType = this.innovatorInstance.newItem();

            methodItemType.loadAML(methodItemTypeAML.OuterXml);

            this.arasDataProvider.GetMethodItemTypeInfo().Returns(new MethodItemTypeInfo(methodItemType, messageManager));

            this.createMethodViewModel = new CreateMethodViewModel(authManager,
                                                                   dialogFactory,
                                                                   projectConfiguration,
                                                                   templateLoader,
                                                                   packageManager,
                                                                   projectManager,
                                                                   arasDataProvider,
                                                                   codeProvider,
                                                                   globalConfiguration,
                                                                   messageManager);
        }
 public AuthenticationManagerProxy(IServerConnection serverConnection, Innovator innovator, InnovatorUser innovatorUser, IIOMWrapper iOMWrapperInstance)
 {
     this.ServerConnection   = serverConnection;
     this.InnovatorInstance  = innovator;
     this.InnovatorUser      = innovatorUser;
     this.IOMWrapperInstance = iOMWrapperInstance;
 }