public void CanForbidNameForbiddenInUpperScopeAndCanMethodsReturnAsExpected()
        {
            var _upperScopeNaming = new SyntaxerNamingContext(null);

            Assert.True(_upperScopeNaming.CanForbidName("name"));
            Assert.True(_upperScopeNaming.CanUseName("name"));

            Assert.True(_upperScopeNaming.TryForbidName("name"));

            Assert.True(_upperScopeNaming.CanForbidName("name"));
            Assert.False(_upperScopeNaming.CanUseName("name"));

            var _naming = new SyntaxerNamingContext(_upperScopeNaming);

            Assert.True(_upperScopeNaming.CanForbidName("name"));
            Assert.False(_upperScopeNaming.CanUseName("name"));

            Assert.True(_naming.CanForbidName("name"));
            Assert.True(_naming.CanUseName("name"));

            Assert.True(_naming.TryForbidName("name"));

            Assert.True(_upperScopeNaming.CanForbidName("name"));
            Assert.False(_upperScopeNaming.CanUseName("name"));

            Assert.True(_naming.CanForbidName("name"));
            Assert.False(_naming.CanUseName("name"));
        }
        public void CanForbidNameForbiddenInUpperScope()
        {
            var _upperScopeNaming = new SyntaxerNamingContext(null);
            Assert.True(_upperScopeNaming.TryForbidName("name"));

            var _naming = new SyntaxerNamingContext(_upperScopeNaming);
            Assert.True(_naming.TryForbidName("name"));
        }
        public void CanForbidNameOnEmptyContextAndCanMethodsReturnAsExpected()
        {
            var _naming = new SyntaxerNamingContext(null);

            Assert.True(_naming.CanUseName("name"));
            Assert.True(_naming.CanForbidName("name"));

            Assert.True(_naming.TryForbidName("name"));

            Assert.True(_naming.CanForbidName("name"));
            Assert.False(_naming.CanUseName("name"));
        }
        public void CanForbidNameOnEmptyContext()
        {
            var _naming = new SyntaxerNamingContext(null);

            Assert.True(_naming.TryForbidName("name"));
        }
        public void CannotUseNameForbiddenInLowerScope()
        {
            var _naming = new SyntaxerNamingContext(null);
            var _lowerScopeNaming = new SyntaxerNamingContext(_naming);

            Assert.True(_lowerScopeNaming.TryForbidName("name"));

            Assert.False(_naming.TryUseName("name"));
        }
        public void CannotUseForbiddenName()
        {
            var _naming = new SyntaxerNamingContext(null);

            Assert.True(_naming.TryForbidName("name"));
            Assert.False(_naming.TryUseName("name"));
        }
        public void CannotForbidNameUsedInUpperScope()
        {
            var _upperScopeNaming = new SyntaxerNamingContext(null);
            Assert.True(_upperScopeNaming.TryUseName("name"));

            var _naming = new SyntaxerNamingContext(_upperScopeNaming);
            Assert.False(_naming.TryForbidName("name"));
        }