Beispiel #1
0
        public void Register_WithDefaultProperties_UsesComponentPathAndPackageGuidValue()
        {
            var attribute    = new ProvideBindingPathAttribute();
            var expectedKeys = new Hashtable()
            {
                //Build the data for each reg key entry in the hash table.
                {
                    @"BindingPaths\".ToUpperInvariant() + ContextMock.GetType().GUID.ToString("B").ToUpperInvariant(),
                    new Hashtable()
                    {
                        { Path.GetDirectoryName(Assembly.GetExecutingAssembly().EscapedCodeBase).ToUpperInvariant(), "" }
                    }
                }
            };

            AttributeCommonTest.RegistrationTest(attribute, expectedKeys, new BaseRegistrationContextMock());
        }
Beispiel #2
0
        public void Register_WithSubFolderSpecified_UsesPackageFolderTokenWithSubTokenAndPackageGuidValue()
        {
            var attribute = new ProvideBindingPathAttribute()
            {
                SubPath = "subFolder",
            };

            var expectedKeys = new Hashtable()
            {
                //Build the data for each reg key entry in the hash table.
                {
                    @"BindingPaths\".ToUpperInvariant() + ContextMock.GetType().GUID.ToString("B").ToUpperInvariant(),
                    new Hashtable()
                    {
                        { Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().EscapedCodeBase), "subFolder").ToUpperInvariant(), "" }
                    }
                }
            };

            AttributeCommonTest.RegistrationTest(attribute, expectedKeys, new BaseRegistrationContextMock());
        }