Beispiel #1
0
        public void CutPasteAgentFromSubFolderToroot()
        {
            //Arrange
            string    name       = "Move Me Up";
            string    folderName = "MySubFolder 2";
            AgentsPOM AgentsPOM  = mGingerAutomator.MainWindowPOM.GotoAgents();

            AgentsPOM.AgentsTree.SelectRootItem();
            AgentsPOM.AddSubFolder(folderName);
            Agent MyAgent = AgentsPOM.CreateAgent(folderName, name, ePlatformType.Web, Agent.eDriverType.SeleniumChrome);

            //Act
            AgentsPOM.AgentsTree.SelectItem(name);
            AgentsPOM.AgentsTree.Cut();
            AgentsPOM.AgentsTree.SelectRootItem();
            AgentsPOM.AgentsTree.Paste();

            bool agentExist = AgentsPOM.AgentsTree.IsItemExist(name);

            RepositoryFolder <Agent> AgentsFolder = WorkSpace.Instance.SolutionRepository.GetRepositoryItemRootFolder <Agent>();
            RepositoryFolder <Agent> subFolder    = AgentsFolder.GetSubFolder(folderName);
            Agent ACopyTag = (from x in subFolder.GetFolderItems() where x.Name == name select x).SingleOrDefault();

            // assert
            Assert.IsTrue(agentExist, "Agent exist");
            Assert.IsTrue(ACopyTag != null);
            Assert.AreEqual(@"~\Agents\" + folderName, ACopyTag.ContainingFolder);
            Assert.AreEqual(MyAgent, ACopyTag, "Same agent object in memeory");
        }
Beispiel #2
0
        public void ApplicationAPIModelMultipleSoapAndRestSaveAndLoad()
        {
            // Arrange
            RepositoryFolder <ApplicationAPIModel> RFRoot    = SR.GetRepositoryItemRootFolder <ApplicationAPIModel>();
            RepositoryFolder <ApplicationAPIModel> subFolder = (RepositoryFolder <ApplicationAPIModel>)RFRoot.AddSubFolder("SecondFolder");

            //Act
            //add items to root folder
            ApplicationAPIModel AAMS1 = new ApplicationAPIModel()
            {
                Name = "Group1_Operation1"
            };

            SR.AddRepositoryItem(AAMS1);
            ApplicationAPIModel AAMS2 = new ApplicationAPIModel()
            {
                Name = "Group1_Operation2"
            };

            SR.AddRepositoryItem(AAMS2);
            ApplicationAPIModel AAMS3 = new ApplicationAPIModel()
            {
                Name = "Group1_Operation3"
            };

            SR.AddRepositoryItem(AAMS3);
            //add items to sub folder items
            ApplicationAPIModel AAMR1 = new ApplicationAPIModel()
            {
                Name = "Group2_Operation1"
            };

            subFolder.AddRepositoryItem(AAMR1);
            ApplicationAPIModel AAMR2 = new ApplicationAPIModel()
            {
                Name = "Group2_Operation2"
            };

            subFolder.AddRepositoryItem(AAMR2);
            ApplicationAPIModel AAMR3 = new ApplicationAPIModel()
            {
                Name = "Group2_Operation3"
            };

            subFolder.AddRepositoryItem(AAMR3);

            ObservableList <ApplicationAPIModel>   AAMBList          = SR.GetAllRepositoryItems <ApplicationAPIModel>();
            RepositoryFolder <ApplicationAPIModel> SecondFolder      = RFRoot.GetSubFolder("SecondFolder");
            ObservableList <ApplicationAPIModel>   AAMBListSubFolder = SecondFolder.GetFolderItems();


            //Assert
            // Assert.AreEqual(AAMBList.Count, 6, "All appllication models including sub folders"); - cannot compare since we run several tests in parallel
            Assert.AreEqual(AAMBListSubFolder.Count, 3, "Second Folder should have 3 files");
        }