Ejemplo n.º 1
0
        public void RunTest()
        {
            Info MutantInfo = new Info();

            MutantInfo.URL              = "Test";
            MutantInfo.Username         = "******";
            MutantInfo.Password         = "******";
            MutantInfo.WorkingDirectory = "Test";

            string CurrentDirectory = Directory.GetCurrentDirectory();

            using (StreamWriter file = File.CreateText(CurrentDirectory + @"\.credentials"))
            {
                JsonSerializer serializer = new JsonSerializer();
                serializer.Serialize(file, MutantInfo);
            }

            TestLevelFactory factory = new TestLevelFactory();
            ITestLevel       level   = factory.CreateTestLevel("None");

            MainEngine engine = new MainEngine(level, "deployZip");

            try
            {
                engine.Run();
            }
            catch (Exception)
            {
                Console.WriteLine("Expected ex.");
            }
        }
Ejemplo n.º 2
0
        public void DeployTest()
        {
            Info MutantInfo = new Info();

            MutantInfo.URL              = "Test";
            MutantInfo.Username         = "******";
            MutantInfo.Password         = "******";
            MutantInfo.WorkingDirectory = "Test";

            string CurrentDirectory = Directory.GetCurrentDirectory();

            using (StreamWriter file = File.CreateText(CurrentDirectory + @"\.credentials"))
            {
                JsonSerializer serializer = new JsonSerializer();
                serializer.Serialize(file, MutantInfo);
            }

            ArtificerFactory artificerFactory = new ArtificerFactory();
            Artificer        selective        = artificerFactory.GetArtificer("Selective");
            TestLevelFactory testFactory      = new TestLevelFactory();
            ITestLevel       none             = testFactory.CreateTestLevel("None");

            Deployment deployment = new Deployment(none, selective);

            try
            {
                deployment.Deploy();
            }
            catch (Exception)
            {
                Console.WriteLine("Expected ex.");
            }
        }
Ejemplo n.º 3
0
        public override int Run(string[] remainingArguments)
        {
            try
            {
                TestLevelFactory TestLevel = new TestLevelFactory();
                ITestLevel       tests     = TestLevel.CreateTestLevel(TestType);

                ArtificerFactory ArtificerFactory = new ArtificerFactory();
                Artificer        artificer        = ArtificerFactory.GetArtificer(ArtificeType);
                artificer.BaseCommit = BaseCommit;

                Deployment deployment = new Deployment(tests, artificer);

                deployment.Deploy();
            } catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return(1);
            }

            return(0);
        }