public void TestEmptyRootINTERSECTCohortContainer_IsProblem()
        {
            var container = WhenIHaveA <CohortAggregateContainer>();

            container.Operation = SetOperation.INTERSECT;

            var pp = new CatalogueProblemProvider();

            pp.RefreshProblems(new CatalogueChildProvider(Repository, null, new ThrowImmediatelyCheckNotifier(), null));
            var problem = pp.DescribeProblem(container);

            Assert.IsNotNull(problem);
            Assert.AreEqual("EXCEPT and INTERSECT container operations must have at least two elements within", problem);
        }
        public void TestEmptyRootUNIONCohortContainer_IsProblem()
        {
            var container = WhenIHaveA <CohortAggregateContainer>();

            container.Operation = SetOperation.UNION;

            var pp = new CatalogueProblemProvider();

            pp.RefreshProblems(new CatalogueChildProvider(Repository, null, new ThrowImmediatelyCheckNotifier(), null));
            var problem = pp.DescribeProblem(container);

            Assert.IsNotNull(problem);
            Assert.AreEqual("You must have at least one element in the root container", problem);
        }
        public void Test1ChildRootUNIONCohortContainer_IsOk()
        {
            var container = WhenIHaveA <CohortAggregateContainer>();
            var childAggregateConfiguration = WhenIHaveA <AggregateConfiguration>();

            container.Operation = SetOperation.UNION;
            container.AddChild(childAggregateConfiguration, 0);

            var pp = new CatalogueProblemProvider();

            pp.RefreshProblems(new CatalogueChildProvider(Repository, null, new ThrowImmediatelyCheckNotifier(), null));
            var problem = pp.DescribeProblem(container);

            Assert.IsNull(problem);
        }
        public void TestSetContainerINTERSECT_IsProblem()
        {
            var container      = WhenIHaveA <CohortAggregateContainer>();
            var childContainer = new CohortAggregateContainer(Repository, SetOperation.INTERSECT);

            container.AddChild(childContainer);

            var pp = new CatalogueProblemProvider();

            pp.RefreshProblems(new CatalogueChildProvider(Repository, null, new ThrowImmediatelyCheckNotifier(), null));
            var problem = pp.DescribeProblem(childContainer);

            Assert.IsNotNull(problem);
            Assert.AreEqual("SET containers cannot be empty", problem);
        }
        public void TestSetContainer1ChildINTERSECT_IsProblem()
        {
            var container      = WhenIHaveA <CohortAggregateContainer>();
            var childContainer = new CohortAggregateContainer(Repository, SetOperation.INTERSECT);
            var childAggregateConfiguration = WhenIHaveA <AggregateConfiguration>();

            childContainer.AddChild(childAggregateConfiguration, 0);
            container.AddChild(childContainer);

            var pp = new CatalogueProblemProvider();

            pp.RefreshProblems(new CatalogueChildProvider(Repository, null, new ThrowImmediatelyCheckNotifier(), null));
            var problem = pp.DescribeProblem(childContainer);

            Assert.IsNotNull(problem);
            Assert.AreEqual("SET container operations have no effect if there is only one child within", problem);
        }
        public void TestRootOrderCohortContainer_IsProblem()
        {
            var container = WhenIHaveA <CohortAggregateContainer>();
            var childAggregateConfiguration  = WhenIHaveA <AggregateConfiguration>();
            var childAggregateConfiguration2 = WhenIHaveA <AggregateConfiguration>();

            container.Operation = SetOperation.UNION;
            container.AddChild(childAggregateConfiguration, 1);
            container.AddChild(childAggregateConfiguration2, 1);

            var pp = new CatalogueProblemProvider();

            pp.RefreshProblems(new CatalogueChildProvider(Repository, null, new ThrowImmediatelyCheckNotifier(), null));
            var problem = pp.DescribeProblem(container);

            Assert.IsNotNull(problem);
            Assert.AreEqual("Child order is ambiguous, show the Order column and reorder contents", problem);
        }