Exemple #1
0
        public void RunSetConfigSaveLoad()
        {
            //Arrange

            //Act
            RunSetConfig RSC = new RunSetConfig();

            RSC.Name = "UT RSC1";
            GingerRunner ARC1 = new GingerRunner();

            ARC1.Name = " Agent 1";
            BusinessFlowRun BFR = new BusinessFlowRun();

            BFR.BusinessFlowName = "BF1";
            ARC1.BusinessFlowsRunList.Add(BFR);
            RSC.GingerRunners.Add(ARC1);
            RSC.SaveToFile(@"c:\temp\UTRSC1.xml");

            //Assert

            RunSetConfig RSC2 = (RunSetConfig)RepositoryItem.LoadFromFile(typeof(RunSetConfig), @"c:\temp\UTRSC1.xml");
        }
Exemple #2
0
        public void TestObjectAttrofOneRepoItem()
        {
            //Check Save and Load of RunSetConfig with Send Email action - RunSetActionSendEmail have 'Email' field which is single object as field, if save load correctly test pass

            //Arrange
            RunSetConfig          RSC   = new RunSetConfig();
            RunSetActionSendEmail RSASE = new RunSetActionSendEmail();

            RSASE.Name = "Send Email";
            string MailFrom = "*****@*****.**";
            string MailTo   = "*****@*****.**";
            string MailCC   = "*****@*****.**";

            RSASE.Email.MailFrom = MailFrom;
            RSASE.Email.MailTo   = MailTo;
            RSASE.Email.MailCC   = MailCC;
            RSC.RunSetActions.Add(RSASE);

            //Act
            string FileName = TestResources.GetTempFile("RunSetConfig1.xml");

            RSC.SaveToFile(FileName);

            //

            RunSetConfig RSC2 = (RunSetConfig)RepositoryItem.LoadFromFile(FileName);

            //Assert
            Assert.AreEqual(RSC.Name, RSC2.Name, "RSC.Name");

            RunSetActionSendEmail RSASE2 = (RunSetActionSendEmail)RSC.RunSetActions[0];

            Assert.AreEqual(RSASE2.Email.MailFrom, MailFrom, "RSC2.MailFrom");
            Assert.AreEqual(RSASE2.Email.MailTo, MailTo, "RSC2.MailTo");
            Assert.AreEqual(RSASE2.Email.MailCC, MailCC, "RSC2.MailCC");
        }
Exemple #3
0
        public void RunSetConfigSaveLoad()
        {
            //Arrange"
            string TempFilepath = TestResources.GetTempFile("UTRSC1.xml");

            //Act
            RunSetConfig RSC = new RunSetConfig();

            RSC.Name = "UT RSC1";
            GingerRunner ARC1 = new GingerRunner();

            ARC1.Name = " Agent 1";
            BusinessFlowRun BFR = new BusinessFlowRun();

            BFR.BusinessFlowName = "BF1";
            ARC1.BusinessFlowsRunList.Add(BFR);
            RSC.GingerRunners.Add(ARC1);

            RSC.SaveToFile(TempFilepath);

            //Assert

            RunSetConfig RSC2 = (RunSetConfig)RepositoryItem.LoadFromFile(typeof(RunSetConfig), TempFilepath);
        }