public void SystemTokenThrows() { RemoveWildcardVisitor visitor = new RemoveWildcardVisitor(); SystemToken token = new SystemToken(ExpressionConstants.It, null); Action visitSystemToken = () => token.Accept(visitor); visitSystemToken.ShouldThrow<NotSupportedException>().WithMessage(Strings.ALinq_IllegalSystemQueryOption(ExpressionConstants.It)); }
public void PathWithoutWildcardIsInvariant() { RemoveWildcardVisitor visitor = new RemoveWildcardVisitor(); NonSystemToken token = new NonSystemToken("stuff", null, null); token.Accept(visitor); token.Identifier.Should().Be("stuff"); token.NextToken.Should().BeNull(); }
public void WildcardIsRemoved() { RemoveWildcardVisitor visitor = new RemoveWildcardVisitor(); NonSystemToken token = new NonSystemToken("stuff", null, new NonSystemToken("*", null, null)); token.Accept(visitor); token.Identifier.Should().Be("stuff"); token.NextToken.Should().BeNull(); }
public void WildcardIsRemoved() { RemoveWildcardVisitor visitor = new RemoveWildcardVisitor(); NonSystemToken token = new NonSystemToken("stuff", null, new NonSystemToken("*", null, null)); token.Accept(visitor); Assert.Equal("stuff", token.Identifier); Assert.Null(token.NextToken); }
public void SystemTokenThrows() { RemoveWildcardVisitor visitor = new RemoveWildcardVisitor(); SystemToken token = new SystemToken(ExpressionConstants.It, null); Action visitSystemToken = () => token.Accept(visitor); NotSupportedException exception = Assert.Throws <NotSupportedException>(visitSystemToken); Assert.Equal(Strings.ALinq_IllegalSystemQueryOption(ExpressionConstants.It), exception.Message); }
public void PathWithoutWildcardIsInvariant() { RemoveWildcardVisitor visitor = new RemoveWildcardVisitor(); NonSystemToken token = new NonSystemToken("stuff", null, null); token.Accept(visitor); Assert.Equal("stuff", token.Identifier); Assert.Null(token.NextToken); }