Exemple #1
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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        public void ShouldNotAllowAnInvalidParent()
        {
            RepositoryItemBuilder bLibrary = DefaultItem.WithParent(APackage.WithStereotype("SOME-OTHER-KIND-OF-PACKAGE").WithParent(APackage));

            VerifyConstraintViolations(bLibrary, bLibrary);
        }
Exemple #4
0
 public void ShouldAllowABLibraryAsParent()
 {
     VerifyConstraintViolations(DefaultItem.WithParent(APackage.WithStereotype(Stereotype.bLibrary).WithParent(APackage)));
 }
Exemple #5
0
 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));
 }