public void ThrowsExceptionForDuplicateOfAutoKey()
        {
            // Arrange
            var client = Substitute.For<IRawGraphClient>();
            var query = new CypherFluentQuery(client)
                .Start("n", (NodeReference)3);

            // Assert
            var ex = Assert.Throws<ArgumentException>(
                () => query.WithParam("p0", 456)
            );
            Assert.AreEqual("key", ex.ParamName);
            Assert.AreEqual("A parameter with the given key is already defined in the query.\r\nParameter name: key", ex.Message);
        }
        public void ThrowsExceptionForDuplicateOfAutoKey()
        {
            // Arrange
            var client = Substitute.For <IRawGraphClient>();
            var query  = new CypherFluentQuery(client)
                         .Start("n", (NodeReference)3);

            // Assert
            var ex = Assert.Throws <ArgumentException>(
                () => query.WithParam("p0", 456)
                );

            Assert.Equal("key", ex.ParamName);
            Assert.Equal("A parameter with the given key is already defined in the query.\r\nParameter name: key", ex.Message);
        }
Exemple #3
0
        public void ThrowsExceptionForDuplicateOfAutoKey()
        {
            // Arrange
            var client = Substitute.For <IRawGraphClient>();
            var query  = new CypherFluentQuery(client)
                         .Match("n")
                         .Where((FooWithJsonProperties n) => n.Bar == "test");

            // Assert
            var ex = Assert.Throws <ArgumentException>(
                () => query.WithParam("p0", 456)
                );

            Assert.Equal("key", ex.ParamName);
            Assert.Equal("A parameter with the given key is already defined in the query." + Environment.NewLine + "Parameter name: key", ex.Message);
        }