public void IsExisting_Id() { var parent = new ScopedNameResolver(); var sut = new ScopedNameResolver(parent); parent.Register("a", new Query()); sut.Register("b", new Query()); Assert.True(sut.IsExisting("a")); Assert.False(sut.IsExistingInCurrentScope("a")); Assert.True(sut.IsExisting("b")); Assert.True(sut.IsExistingInCurrentScope("b")); Assert.True(parent.IsExisting("a")); Assert.True(parent.IsExistingInCurrentScope("a")); }
public void IsExisting_Type() { var parent = new ScopedNameResolver(); var sut = new ScopedNameResolver(parent); parent.Register(Type("A"), new Query()); sut.Register(Type("B"), new Query()); Assert.True(sut.IsExisting(Type("A"))); Assert.False(sut.IsExistingInCurrentScope(Type("A"))); Assert.True(sut.IsExisting(Type("B"))); Assert.True(sut.IsExistingInCurrentScope(Type("B"))); Assert.True(parent.IsExisting(Type("A"))); Assert.True(parent.IsExistingInCurrentScope(Type("A"))); }