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")); }
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)); }
public MockBuilderContext(IReadWriteLocator locator) { InnerLocator = locator; SetLocator(InnerLocator); StrategyChain = InnerChain; SetPolicies(InnerPolicies); if (!Locator.Contains(typeof(ILifetimeContainer))) { Locator.Add(typeof(ILifetimeContainer), lifetimeContainer); } }
public void NullKeyOnContainsThrows() { IReadWriteLocator locator = new Locator(); locator.Contains(null); }
public void BadSearchModeOnContainsThrows() { IReadWriteLocator locator = new Locator(); locator.Contains(1, (SearchMode)254); }