Example #1
0
        public static object LoadFromFile(string FileName)
        {
            GingerCore.Repository.RepositorySerializer RS = new RepositorySerializer();
            RepositoryItemBase ri = (RepositoryItemBase)RS.DeserializeFromFile(FileName);

            ri.FileName = FileName;
            return(ri);
        }
Example #2
0
        public void BusinessFlowDeserializationTest()
        {
            //Arrange
            RepositorySerializer RepositorySerializer = new RepositorySerializer();
            string sFileName = TestResources.GetTestResourcesFile(@"Converter\IPDLSAM.Ginger.BusinessFlow.xml");

            //Act
            BusinessFlow BF = (BusinessFlow)RepositorySerializer.DeserializeFromFile(typeof(BusinessFlow), sFileName);

            //Assert
            //TODO: add more asserts
            Assert.AreEqual(BF.Activities.Count(), 14);
        }
        public void EnvironmentDeserializationTest()
        {
            //Arrange
            RepositorySerializer RepositorySerializer = new RepositorySerializer();
            string sFileName = TestResources.GetTestResourcesFile(@"Converter" + Path.DirectorySeparatorChar + "CMI.Ginger.Environment.xml");

            //Act
            ProjEnvironment env = (ProjEnvironment)RepositorySerializer.DeserializeFromFile(typeof(ProjEnvironment), sFileName);

            //Assert
            Assert.AreEqual(env.Name, "CMI IIS test server");
            Assert.AreEqual(env.Applications.Count, 2);
            //TODO: add more asserts
        }
        public void AgentDeserializationTest()
        {
            //Arrange
            RepositorySerializer RepositorySerializer = new RepositorySerializer();
            string sFileName = TestResources.GetTestResourcesFile(@"Converter" + Path.DirectorySeparatorChar + "IB1.Ginger.Agent.xml");

            //Act
            Agent agent = (Agent)RepositorySerializer.DeserializeFromFile(typeof(Agent), sFileName);

            //Assert
            //TODO: add more asserts
            Assert.AreEqual(agent.Name, "IB1");
            Assert.AreEqual(agent.DriverType, Agent.eDriverType.InternalBrowser);
        }