示例#1
0
        public void Register_Registers_Element()
        {
            var target  = new NameScope();
            var element = new object();

            target.Register("foo", element);

            Assert.Same(element, target.Find("foo"));
        }
示例#2
0
        public void Register_Registers_Element()
        {
            var target = new NameScope();
            var element = new object();

            target.Register("foo", element);

            Assert.Same(element, target.Find("foo"));
        }
示例#3
0
        public void Can_Register_Same_Element_More_Than_Once()
        {
            var target  = new NameScope();
            var element = new object();

            target.Register("foo", element);
            target.Register("foo", element);

            Assert.Same(element, target.Find("foo"));
        }
示例#4
0
        public void Can_Register_Same_Element_More_Than_Once()
        {
            var target = new NameScope();
            var element = new object();

            target.Register("foo", element);
            target.Register("foo", element);

            Assert.Same(element, target.Find("foo"));
        }
示例#5
0
        public void Unregister_Unregisters_Element()
        {
            var target = new NameScope();
            var element = new object();

            target.Register("foo", element);
            target.Unregister("foo");

            Assert.Null(target.Find("foo"));
        }
示例#6
0
        public void Unregister_Unregisters_Element()
        {
            var target  = new NameScope();
            var element = new object();

            target.Register("foo", element);
            target.Unregister("foo");

            Assert.Null(target.Find("foo"));
        }
示例#7
0
 object INameScope.Find(string name)
 {
     return(_nameScope.Find(name));
 }
示例#8
0
 public object Find(string name) => _nameScope.Find(name);
示例#9
0
 public object Find(string name)
 {
     return(_nameScope.Find(name));
 }