Exemple #1
0
        public void SolutionSaveRestoreTest()
        {
            var solution = DataGenerator.CreateSolution();

            Assert.IsNotNull(solution, "Failed creating Solution.");

            // Keep source ToString
            var src = solution.ToString();

            // Start edit
            solution.BeginEdit();

            solution.SolutionName  = "edited";
            solution.Path          = "edited";
            solution.Task          = (Lists.CreateTasks() as List <string>)[1];
            solution.Configuration = (Lists.CreateConfigurations() as List <string>)[1];
            solution.Platform      = (Lists.CreatePlatforms() as List <string>)[1];
            solution.Condition     = (Lists.CreateConditions() as List <string>)[1];

            // Cancel edit.
            solution.CancelEdit();

            // Check.
            Assert.AreEqual(src, solution.ToString(), "Failed save/restore");
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance Model class.
        /// </summary>
        /// <param name="solution">The Solution.</param>
        public Model(Data.Solution solution)
        {
            Solution = solution;

            TaskList          = Lists.CreateTasks();
            PlatformList      = Lists.CreatePlatforms();
            ConfigurationList = Lists.CreateConfigurations();
            ConditionList     = Lists.CreateConditions();
        }
Exemple #3
0
        /// <summary>
        /// Creates new Solution object.
        /// </summary>
        /// <returns>The new Solution object.</returns>
        public static Solution CreateSolution()
        {
            var solution = new Solution
            {
                Condition     = Lists.CreateConditions().First(),
                Path          = String.Format(@"c:\work\solution_{0}.sln", SolutionNumber),
                Configuration = Lists.CreateConditions().First(),
                Platform      = Lists.CreatePlatforms().First(),
                SolutionName  = String.Format("solution_{0}", SolutionNumber),
                State         = State.Unknown,
                Task          = Lists.CreateTasks().First(),
            };

            ++SolutionNumber;

            return(solution);
        }