public void ShouldNotAllowAnySubpackages()
        {
            RepositoryItemBuilder aPackage       = APackage;
            RepositoryItemBuilder elementLibrary = DefaultItem.WithChild(aPackage);

            VerifyConstraintViolations(elementLibrary, aPackage);
        }
示例#2
0
        public void ShouldNotAllowElements()
        {
            RepositoryItemBuilder element1 = AnElement;
            RepositoryItemBuilder element2 = AnElement;
            RepositoryItemBuilder bLibrary = DefaultItem.WithChild(element1).WithChild(element2);

            VerifyConstraintViolations(bLibrary, element1, element2);
        }
        public void ShouldOnlyAllowElementsWithTheProperStereotype()
        {
            RepositoryItemBuilder element1       = AnElement.WithStereotype(elementStereotype);
            RepositoryItemBuilder element2       = AnElement.WithStereotype("other than " + elementStereotype);
            RepositoryItemBuilder elementLibrary = DefaultItem.WithChild(element1).WithChild(element2);

            ExpectConstraintViolation(element2);
            Validate(elementLibrary);
        }
示例#4
0
        public void ShouldOnlyAllowBusinessLibrariesAsSubpackages()
        {
            RepositoryItemBuilder invalidSubPackage = APackage.WithStereotype("other-that-a-business-library-stereotype");
            RepositoryItemBuilder bLibrary          = DefaultItem
                                                      .WithChild(APackage.WithStereotype(Stereotype.bLibrary))
                                                      .WithChild(APackage.WithStereotype(Stereotype.PRIMLibrary))
                                                      .WithChild(APackage.WithStereotype(Stereotype.ENUMLibrary))
                                                      .WithChild(APackage.WithStereotype(Stereotype.CDTLibrary))
                                                      .WithChild(APackage.WithStereotype(Stereotype.CCLibrary))
                                                      .WithChild(APackage.WithStereotype(Stereotype.BDTLibrary))
                                                      .WithChild(APackage.WithStereotype(Stereotype.BIELibrary))
                                                      .WithChild(APackage.WithStereotype(Stereotype.DOCLibrary))
                                                      .WithChild(invalidSubPackage);

            VerifyConstraintViolations(bLibrary, invalidSubPackage);
        }