public void ShouldNotAllowAnySubpackages() { RepositoryItemBuilder aPackage = APackage; RepositoryItemBuilder elementLibrary = DefaultItem.WithChild(aPackage); VerifyConstraintViolations(elementLibrary, aPackage); }
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); }
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); }