Пример #1
0
        public PlanManager()
        {
            RelatedChanges    = new List <string>();
            ProcessedElements = new List <object>();
            IsInitialAction   = new IsInitialActionSpecification <Program>();

            if (AppHostBase.Instance != null)
            {
                AppHostBase.Instance.Container.AutoWire(this);
            }
        }
Пример #2
0
            public void One_Action_completed()
            {
                Program p = new Program
                {
                    Name        = "sample program",
                    Id          = ObjectId.GenerateNewId().ToString(),
                    Description = "Sample description",
                    Modules     = new List <Module>
                    {
                        new Module {
                            Id      = ObjectId.GenerateNewId().ToString(),
                            Name    = "Sample Module 1",
                            Actions = new List <Actions> {
                                new Actions {
                                    Id        = ObjectId.GenerateNewId().ToString(),
                                    Name      = "Module 1 action 1",
                                    Completed = false
                                },
                                new Actions {
                                    Id        = ObjectId.GenerateNewId().ToString(),
                                    Name      = "Module 1 action 2",
                                    Completed = false
                                }
                            }
                        },
                        new Module {
                            Id      = ObjectId.GenerateNewId().ToString(),
                            Name    = "Sample Module 2",
                            Actions = new List <Actions> {
                                new Actions {
                                    Id        = ObjectId.GenerateNewId().ToString(),
                                    Name      = "Module 2 action 1",
                                    Completed = false
                                },
                                new Actions {
                                    Id        = ObjectId.GenerateNewId().ToString(),
                                    Name      = "Module 2 action 2",
                                    Completed = true
                                }
                            }
                        }
                    }
                };

                IsInitialActionSpecification <Program> IsInitAction = new IsInitialActionSpecification <Program>();
                bool result = IsInitAction.IsSatisfiedBy(p);

                Assert.IsFalse(result);
            }