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); }
public static IResource CreateResource(IResourceIndexEntry entry, IPackage package) { Type t = GetHandler(entry["ResourceType"]); if (t == null) { return(null); } APackage localPackage = package as APackage; try { return(t.GetConstructor(new Type[] { typeof(int), typeof(Stream), }).Invoke(new object[] { 0, localPackage.GetResource(entry) }) as IResource); } catch { } return(null); }
public void ShouldNotAllowAnInvalidParent() { RepositoryItemBuilder bLibrary = DefaultItem.WithParent(APackage.WithStereotype("SOME-OTHER-KIND-OF-PACKAGE").WithParent(APackage)); VerifyConstraintViolations(bLibrary, bLibrary); }
public void ShouldAllowABLibraryAsParent() { VerifyConstraintViolations(DefaultItem.WithParent(APackage.WithStereotype(Stereotype.bLibrary).WithParent(APackage))); }
public void ShouldAllowABInformationVAsParent() { VerifyConstraintViolations(DefaultItem.WithParent(APackage.WithStereotype(Stereotype.bInformationV).WithParent(APackage))); }
public void ShouldOnlyAllowABLibraryAsParent() { RepositoryItemBuilder elementLibrary = DefaultItem.WithParent(APackage.WithStereotype("other than bLibrary")); VerifyConstraintViolations(elementLibrary, elementLibrary); }
public void ShouldOnlyAllowAPRIMLibraryAsParent() { RepositoryItemBuilder prim = DefaultItem.WithParent(APackage.WithStereotype("other than " + LibraryStereotype)); VerifyConstraintViolations(prim, prim); }
public void ShouldNotMatchPackages() { AssertValidatorDoesNotMatch(APackage.WithStereotype(ElementStereotype)); }