public void ShouldbeAbleToAddMultiInputArgument() { var builder = new ContentTypeQueryResourceBuilder("someContentType"); builder.WithQueryArgument("arg", "a", "1"); builder.WithQueryArgument("arg", "b", "2"); Assert.Equal("someContentType(arg:{a: 1, b: 2}) {}", builder.Build()); }
public void ShouldbeAbleToAddMultipleArguments() { var builder = new ContentTypeQueryResourceBuilder("someContentType"); builder.WithQueryArgument("arg", "1"); builder.WithQueryArgument("arg2", "2"); Assert.Equal("someContentType(arg: 1 arg2: 2) {}", builder.Build()); }
public void ShouldNotBeAbleToAddDuplicateArguments() { var builder = new ContentTypeQueryResourceBuilder("someContentType"); builder.WithQueryArgument("arg", "a"); Assert.Throws <Exception>(() => builder.WithQueryArgument("arg", "b")); Assert.Throws <Exception>(() => builder.WithQueryArgument("arg", "b", "2")); Assert.Throws <Exception>(() => builder.WithNestedQueryArgument("arg", "b", "2")); }