Beispiel #1
0
        public void CanFindOutIfContainsAKey()
        {
            object            o       = new object();
            IReadWriteLocator locator = new Locator();

            locator.Add("foo", o);
            Assert.IsTrue(locator.Contains("foo"));
            Assert.IsFalse(locator.Contains("foo2"));
        }
Beispiel #2
0
        public void CanCallContainsThroughParent()
        {
            object            o            = new object();
            IReadWriteLocator rootLocator  = new Locator();
            IReadWriteLocator childLocator = new Locator(rootLocator);

            rootLocator.Add("froz", o);

            Assert.IsFalse(childLocator.Contains("froz", SearchMode.Local));
            Assert.IsTrue(childLocator.Contains("froz", SearchMode.Up));
        }
Beispiel #3
0
        public MockBuilderContext(IReadWriteLocator locator)
        {
            InnerLocator = locator;
            SetLocator(InnerLocator);
            StrategyChain = InnerChain;
            SetPolicies(InnerPolicies);

            if (!Locator.Contains(typeof(ILifetimeContainer)))
            {
                Locator.Add(typeof(ILifetimeContainer), lifetimeContainer);
            }
        }
Beispiel #4
0
        public void NullKeyOnContainsThrows()
        {
            IReadWriteLocator locator = new Locator();

            locator.Contains(null);
        }
Beispiel #5
0
        public void BadSearchModeOnContainsThrows()
        {
            IReadWriteLocator locator = new Locator();

            locator.Contains(1, (SearchMode)254);
        }
Beispiel #6
0
        public void NullKeyOnContainsThrows()
        {
            IReadWriteLocator locator = new Locator();

            locator.Contains(null);
        }
Beispiel #7
0
        public void CanFindOutIfContainsAKey()
        {
            object o = new object();
            IReadWriteLocator locator = new Locator();

            locator.Add("foo", o);
            Assert.IsTrue(locator.Contains("foo"));
            Assert.IsFalse(locator.Contains("foo2"));
        }
Beispiel #8
0
        public void CanCallContainsThroughParent()
        {
            object o = new object();
            IReadWriteLocator rootLocator = new Locator();
            IReadWriteLocator childLocator = new Locator(rootLocator);

            rootLocator.Add("froz", o);

            Assert.IsFalse(childLocator.Contains("froz", SearchMode.Local));
            Assert.IsTrue(childLocator.Contains("froz", SearchMode.Up));
        }
Beispiel #9
0
        public void BadSearchModeOnContainsThrows()
        {
            IReadWriteLocator locator = new Locator();

            locator.Contains(1, (SearchMode)254);
        }