diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..00b60b4 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,5 @@ +# switch from string.format to string expansion +4d2bbd41b883aa1e2628b5bd49ffd07029406773 + +# Reformatted and loads of "add period (.) at the end of documentation" +2dede87f3492fed0374f89da7302d1349ca3e680 diff --git a/resources/GlobalAssemblyInfo.cs b/resources/GlobalAssemblyInfo.cs index 884a218..59f9d2c 100644 --- a/resources/GlobalAssemblyInfo.cs +++ b/resources/GlobalAssemblyInfo.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using System.Reflection; using System.Runtime.InteropServices; diff --git a/src/.editorconfig b/src/.editorconfig new file mode 100644 index 0000000..48c871e --- /dev/null +++ b/src/.editorconfig @@ -0,0 +1,236 @@ +# C# files +[*.cs] + +#### Core EditorConfig Options #### + +# Indentation and spacing +indent_size = 4 +indent_style = space +tab_width = 4 + +# New line preferences +end_of_line = crlf +insert_final_newline = true + +#### .NET Coding Conventions #### + +# Organize usings +dotnet_separate_import_directive_groups = true +dotnet_sort_system_directives_first = true +file_header_template = unset + +# this. and Me. preferences +dotnet_style_qualification_for_event = false:warning +dotnet_style_qualification_for_field = false:warning +dotnet_style_qualification_for_method = false:warning +dotnet_style_qualification_for_property = false:warning + +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true:warning +dotnet_style_predefined_type_for_member_access = true:warning + +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent + +# Modifier preferences +dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning + +# Expression-level preferences +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_object_initializer = true:suggestion +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_prefer_auto_properties = true:silent +dotnet_style_prefer_compound_assignment = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_simplified_interpolation = true:suggestion + +# Field preferences +dotnet_style_readonly_field = true:suggestion + +# Parameter preferences +dotnet_code_quality_unused_parameters = all:suggestion + +#### C# Coding Conventions #### + +# var preferences +csharp_style_var_elsewhere = false:silent +csharp_style_var_for_built_in_types = false:silent +csharp_style_var_when_type_is_apparent = false:silent + +# Expression-bodied members +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent + +# Pattern matching preferences +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_prefer_switch_expression = true:suggestion + +# Null-checking preferences +csharp_style_conditional_delegate_call = true:suggestion + +# Modifier preferences +csharp_prefer_static_local_function = true:suggestion +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent + +# Code-block preferences +csharp_prefer_braces = true:silent +csharp_prefer_simple_using_statement = true:suggestion + +# Expression-level preferences +csharp_prefer_simple_default_expression = true:suggestion +csharp_style_deconstructed_variable_declaration = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion +csharp_style_pattern_local_over_anonymous_function = true:suggestion +csharp_style_prefer_index_operator = true:suggestion +csharp_style_prefer_range_operator = true:suggestion +csharp_style_throw_expression = true:suggestion +csharp_style_unused_value_assignment_preference = discard_variable:suggestion +csharp_style_unused_value_expression_statement_preference = discard_variable:silent + +# 'using' directive preferences +csharp_using_directive_placement = outside_namespace:warning + +#### C# Formatting Rules #### + +# New line preferences +csharp_new_line_before_catch = true +csharp_new_line_before_else = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_open_brace = all +csharp_new_line_between_query_expression_clauses = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = false +csharp_indent_labels = flush_left +csharp_indent_switch_labels = true + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false + +# Wrapping preferences +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = false + +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = warning +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = warning +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.method_should_be_pascal_case.severity = warning +dotnet_naming_rule.method_should_be_pascal_case.symbols = method +dotnet_naming_rule.method_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.public_or_protected_field_should_be_pascal_case.severity = warning +dotnet_naming_rule.public_or_protected_field_should_be_pascal_case.symbols = public_or_protected_field +dotnet_naming_rule.public_or_protected_field_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.private_or_internal_static_field_should_be_pascal_case.severity = warning +dotnet_naming_rule.private_or_internal_static_field_should_be_pascal_case.symbols = private_or_internal_static_field +dotnet_naming_rule.private_or_internal_static_field_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.private_or_internal_field_should_be_camelcase.severity = warning +dotnet_naming_rule.private_or_internal_field_should_be_camelcase.symbols = private_or_internal_field +dotnet_naming_rule.private_or_internal_field_should_be_camelcase.style = camelcase + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = warning +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.method.applicable_kinds = method +dotnet_naming_symbols.method.applicable_accessibilities = public +dotnet_naming_symbols.method.required_modifiers = + +dotnet_naming_symbols.public_or_protected_field.applicable_kinds = field +dotnet_naming_symbols.public_or_protected_field.applicable_accessibilities = public, protected +dotnet_naming_symbols.public_or_protected_field.required_modifiers = + +dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field +dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected +dotnet_naming_symbols.private_or_internal_field.required_modifiers = + +dotnet_naming_symbols.private_or_internal_static_field.applicable_kinds = field +dotnet_naming_symbols.private_or_internal_static_field.applicable_accessibilities = internal, private, private_protected +dotnet_naming_symbols.private_or_internal_static_field.required_modifiers = static + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case + +dotnet_naming_style.camelcase.required_prefix = _ +dotnet_naming_style.camelcase.required_suffix = +dotnet_naming_style.camelcase.word_separator = +dotnet_naming_style.camelcase.capitalization = camel_case + diff --git a/src/CamlGen.Tests/CamlGen.Tests.csproj b/src/CamlGen.Tests/CamlGen.Tests.csproj index 26c7f42..2a10e84 100644 --- a/src/CamlGen.Tests/CamlGen.Tests.csproj +++ b/src/CamlGen.Tests/CamlGen.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net7.0 FluentCamlGen.CamlGen.Tests FluentCamlGen.CamlGen.Tests pdbonly diff --git a/src/CamlGen.Tests/Elements/BaseElementFormatTests.cs b/src/CamlGen.Tests/Elements/BaseElementFormatTests.cs index 8aa7c61..151b09a 100644 --- a/src/CamlGen.Tests/Elements/BaseElementFormatTests.cs +++ b/src/CamlGen.Tests/Elements/BaseElementFormatTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using AutoFixture; @@ -84,4 +84,4 @@ public void ToStringWithOneParamsCallsToStringWithThatParamAndNoIndent() _cgPartialMock.Verify(x => x.ToString(someBool, 0), Times.Once); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/AndTests.cs b/src/CamlGen.Tests/Elements/Core/AndTests.cs index b579e4d..0236ce9 100644 --- a/src/CamlGen.Tests/Elements/Core/AndTests.cs +++ b/src/CamlGen.Tests/Elements/Core/AndTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using Shouldly; @@ -98,4 +98,4 @@ public void NestedAndOnAndReturnsAnAndTagInAnAndTag() sut.ToString().ShouldBe(@""); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/BaseCoreCompareElementTests.cs b/src/CamlGen.Tests/Elements/Core/BaseCoreCompareElementTests.cs index b22f174..dd45886 100644 --- a/src/CamlGen.Tests/Elements/Core/BaseCoreCompareElementTests.cs +++ b/src/CamlGen.Tests/Elements/Core/BaseCoreCompareElementTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using Shouldly; @@ -61,4 +61,4 @@ public void EmptyLeq() sut.ToString().ShouldBe(@""); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/BaseCoreElementCtorTests.cs b/src/CamlGen.Tests/Elements/Core/BaseCoreElementCtorTests.cs index 77cea94..d815033 100644 --- a/src/CamlGen.Tests/Elements/Core/BaseCoreElementCtorTests.cs +++ b/src/CamlGen.Tests/Elements/Core/BaseCoreElementCtorTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using AutoFixture; @@ -32,7 +32,7 @@ public void ATagWithoutAdditionalParamsReturnsTheBareTag() var tag = Fixture.Create(); var sut = new Mock(tag){CallBase = true}.Object; var actual = sut.ToString(false, 0); - actual.ShouldBe(string.Format(@"<{0} />", tag)); + actual.ShouldBe($@"<{tag} />"); } [Fact] @@ -43,7 +43,7 @@ public void ATagWithAnAttributeReturnsTheTagAndTheAttribute() var attrVal = Fixture.Create(); var sut = new Mock(tag, new Tuple(attrName, attrVal)){CallBase = true}.Object; - sut.ToString().ShouldBe(string.Format(@"<{0} {1}=""{2}"" />", tag, attrName, attrVal)); + sut.ToString().ShouldBe($@"<{tag} {attrName}=""{attrVal}"" />"); } [Fact] @@ -70,4 +70,4 @@ public void CamlTagAttributeAndInnerCgReturnsTheTagWithAttributeAndTheNestedCg() sut.ToString().ShouldBe(string.Format(@"<{0} {1}=""{2}"">{3}", tag, attrName, attrVal, inner)); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/BaseCoreElementExtensionsTests.cs b/src/CamlGen.Tests/Elements/Core/BaseCoreElementExtensionsTests.cs index 21cdfdd..d1d693e 100644 --- a/src/CamlGen.Tests/Elements/Core/BaseCoreElementExtensionsTests.cs +++ b/src/CamlGen.Tests/Elements/Core/BaseCoreElementExtensionsTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using AutoFixture; @@ -57,4 +57,4 @@ public void BooleanValueAddAttributeExtensionAddsTheAttribute() actual.ToString().ShouldBe(expected); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/BaseCoreElementFormatTests.cs b/src/CamlGen.Tests/Elements/Core/BaseCoreElementFormatTests.cs index 580904a..441ca4c 100644 --- a/src/CamlGen.Tests/Elements/Core/BaseCoreElementFormatTests.cs +++ b/src/CamlGen.Tests/Elements/Core/BaseCoreElementFormatTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using Shouldly; @@ -46,4 +46,4 @@ public void TwoNestedTagWithFormattingReturnAStringWithFormatting() actual.ShouldBe(string.Format("{0} {0}{0}", Environment.NewLine)); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/BaseCoreElementNestingTests.cs b/src/CamlGen.Tests/Elements/Core/BaseCoreElementNestingTests.cs index 3310b99..50a93dc 100644 --- a/src/CamlGen.Tests/Elements/Core/BaseCoreElementNestingTests.cs +++ b/src/CamlGen.Tests/Elements/Core/BaseCoreElementNestingTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using AutoFixture; @@ -51,4 +51,4 @@ public void DeepNestedElementsReturnsTheDeepNestedTags() outerSut.ToString().ShouldBe(string.Format(@"<{0}><{1}><{2} />", outerTag, middleTag, innerTag)); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/ContainsTests.cs b/src/CamlGen.Tests/Elements/Core/ContainsTests.cs index 7d1f6d3..e8693fb 100644 --- a/src/CamlGen.Tests/Elements/Core/ContainsTests.cs +++ b/src/CamlGen.Tests/Elements/Core/ContainsTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using AutoFixture; @@ -29,7 +29,7 @@ public void BareEqReturnsAnEqTagWithNoAttributes() var lhs = Fixture.Create(); var rhs = Fixture.Create(); var sut = CG.Contains(lhs, rhs); - sut.ToString().ShouldBe(string.Format(@"{0}{1}", lhs, rhs)); + sut.ToString().ShouldBe($@"{lhs}{rhs}"); } [Fact] @@ -41,7 +41,8 @@ public void AddFieldRefAddsAFieldRefToTheElement() sut.AddFieldRef(field); sut.AddValue(CG.ValueType.Text, value); - sut.ToString().ShouldBe(string.Format(@"{1}", field, value)); + sut.ToString().ShouldBe( + $@"{value}"); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/EqTests.cs b/src/CamlGen.Tests/Elements/Core/EqTests.cs index 825d8d6..8f8e75e 100644 --- a/src/CamlGen.Tests/Elements/Core/EqTests.cs +++ b/src/CamlGen.Tests/Elements/Core/EqTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using AutoFixture; @@ -29,7 +29,7 @@ public void BareEqReturnsAnEqTagWithNoAttributes() var lhs = Fixture.Create(); var rhs = Fixture.Create(); var sut = CG.Eq(lhs, rhs); - sut.ToString().ShouldBe(string.Format(@"{0}{1}", lhs, rhs)); + sut.ToString().ShouldBe($@"{lhs}{rhs}"); } [Fact] @@ -39,7 +39,7 @@ public void AddFieldRefAddsAFieldRefToTheElement() var sut = new Eq(); sut.AddFieldRef(field); - sut.ToString().ShouldBe(string.Format(@"", field)); + sut.ToString().ShouldBe($@""); } [Fact] @@ -49,7 +49,7 @@ public void AddValueAddsAValueToTheElement() var sut = new Eq(); sut.AddValue(CG.ValueType.Number, val); - sut.ToString().ShouldBe(string.Format(@"{0}", val)); + sut.ToString().ShouldBe($@"{val}"); } [Fact] @@ -59,7 +59,7 @@ public void AddNumberValueAddsANumerValueToTheElement() var sut = new Eq(); sut.AddNumberValue(val); - sut.ToString().ShouldBe(string.Format(@"{0}", val)); + sut.ToString().ShouldBe($@"{val}"); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/FieldRefTests.cs b/src/CamlGen.Tests/Elements/Core/FieldRefTests.cs index a5d6f42..fbbebe2 100644 --- a/src/CamlGen.Tests/Elements/Core/FieldRefTests.cs +++ b/src/CamlGen.Tests/Elements/Core/FieldRefTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using AutoFixture; @@ -28,7 +28,7 @@ public void BareFieldRefReturnsAFieldRefTagWithANameAttributes() { var name = Fixture.Create(); var sut = CG.FieldRef(name); - sut.ToString().ShouldBe(string.Format(@"", name)); + sut.ToString().ShouldBe($@""); } [Fact] @@ -38,7 +38,7 @@ public void BareFieldRefWithAdditionalAttributesReturnsAFieldRefTagWithANameAndA var additionalName = Fixture.Create(); var additionalValue = Fixture.Create(); var sut = CG.FieldRef(name, new Tuple(additionalName, additionalValue)); - sut.ToString().ShouldBe(string.Format(@"", name, additionalName, additionalValue)); + sut.ToString().ShouldBe($@""); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/JoinTests.cs b/src/CamlGen.Tests/Elements/Core/JoinTests.cs index fca6e32..dd6fe10 100644 --- a/src/CamlGen.Tests/Elements/Core/JoinTests.cs +++ b/src/CamlGen.Tests/Elements/Core/JoinTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using AutoFixture; @@ -31,7 +31,7 @@ public void BareJoinReturnsAJoinTagWithNoAttributes() var rhs = Fixture.Create(); var sut = CG.Join(list, CG.JoinType.Inner, lhs, rhs); - sut.ToString().ShouldBe(string.Format(@"{1}{2}", list, lhs, rhs)); + sut.ToString().ShouldBe($@"{lhs}{rhs}"); } [Fact] @@ -62,7 +62,8 @@ public void AddFieldRefAddsAFieldRefToTheElement() var sut = new Join(list, CG.JoinType.Left); sut.AddFieldRef(field, x => { }); - sut.ToString().ShouldBe(string.Format(@"", list, field)); + sut.ToString().ShouldBe( + $@""); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/JoinsTests.cs b/src/CamlGen.Tests/Elements/Core/JoinsTests.cs index 632f170..73ca69d 100644 --- a/src/CamlGen.Tests/Elements/Core/JoinsTests.cs +++ b/src/CamlGen.Tests/Elements/Core/JoinsTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using AutoFixture; @@ -43,7 +43,7 @@ public void AddJoinReturnsAJoinsTagWithAJoinAndAnEmptyEqTag() var list = Fixture.Create(); var sut = new Joins(); sut.AddJoin(list, CG.JoinType.Left, x => { }); - sut.ToString().ShouldBe(string.Format(@"", list)); + sut.ToString().ShouldBe($@""); } [Fact] @@ -56,4 +56,4 @@ public void AddInnerJoinReturnsAJoinsTagWithAnInnerJoinAndAnEmptyEqTag() sut.ToString().ShouldBe(string.Format(@"", list, field)); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/OrTests.cs b/src/CamlGen.Tests/Elements/Core/OrTests.cs index 7b773de..d250dfb 100644 --- a/src/CamlGen.Tests/Elements/Core/OrTests.cs +++ b/src/CamlGen.Tests/Elements/Core/OrTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using Shouldly; @@ -100,4 +100,4 @@ public void AndOnOrReturnsAnAndTagInAnOrTag() sut.ToString().ShouldBe(@""); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/OrderByTests.cs b/src/CamlGen.Tests/Elements/Core/OrderByTests.cs index 111b5ca..5e0a071 100644 --- a/src/CamlGen.Tests/Elements/Core/OrderByTests.cs +++ b/src/CamlGen.Tests/Elements/Core/OrderByTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using AutoFixture; @@ -32,7 +32,7 @@ public void OrderByWithFieldRefReturnsAnOrderByAndAFieldRef() { var name = Fixture.Create(); var sut = CG.OrderBy().AddFieldRefDescending(name); - var expected = string.Format(@"", name).AsXml(); + var expected = $@"".AsXml(); sut.ToString().AsXml().ShouldBe(expected); } @@ -41,7 +41,7 @@ public void OrderByWithFieldRefAscendingReturnsAnOrderByAndAnAscendingFieldRef() { var name = Fixture.Create(); var sut = CG.OrderBy().AddFieldRefAscending(name); - var expected = string.Format(@"", name).AsXml(); + var expected = $@"".AsXml(); sut.ToString().AsXml().ShouldBe(expected); } @@ -50,8 +50,8 @@ public void FluentOrderByWithFieldRefReturnsAnOrderByAndAFieldRef() { var name = Fixture.Create(); var sut = CG.Query().OrderBy(o => o.AddFieldRef(name, false)); - var expected = string.Format(@"", name).AsXml(); + var expected = $@"".AsXml(); sut.ToString().AsXml().ShouldBe(expected); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/ProjectedFieldTests.cs b/src/CamlGen.Tests/Elements/Core/ProjectedFieldTests.cs index edfb9ef..5c2f23b 100644 --- a/src/CamlGen.Tests/Elements/Core/ProjectedFieldTests.cs +++ b/src/CamlGen.Tests/Elements/Core/ProjectedFieldTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using AutoFixture; @@ -30,7 +30,7 @@ public void BareCgProjectedFieldReturnsAProjectedFieldTagWithAttributes() var showFileld = Fixture.Create(); var sut = CG.ProjectedField(name, type, list, showFileld); sut.ToString() - .ShouldBe(string.Format(@"", name, type, list, showFileld)); + .ShouldBe($@""); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/ProjectedFieldsTests.cs b/src/CamlGen.Tests/Elements/Core/ProjectedFieldsTests.cs index 82677f1..8de2b0e 100644 --- a/src/CamlGen.Tests/Elements/Core/ProjectedFieldsTests.cs +++ b/src/CamlGen.Tests/Elements/Core/ProjectedFieldsTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using AutoFixture; @@ -41,7 +41,8 @@ public void AddFieldReturnsAProjectedFieldsTagWithAField() var sut = new ProjectedFields(); sut.AddField(name, type, list, showField); - sut.ToString().ShouldBe(string.Format(@"", name, type, list, showField)); + sut.ToString().ShouldBe( + $@""); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/QueryOptionsTest.cs b/src/CamlGen.Tests/Elements/Core/QueryOptionsTest.cs index 8dba165..bd3e7c8 100644 --- a/src/CamlGen.Tests/Elements/Core/QueryOptionsTest.cs +++ b/src/CamlGen.Tests/Elements/Core/QueryOptionsTest.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using Shouldly; @@ -51,4 +51,4 @@ public void QueryOptionsWithFluentlyExpandUserFieldReturnsTheNestedExpandUserFie sut.ToString().ShouldBe("True"); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/QueryTests.cs b/src/CamlGen.Tests/Elements/Core/QueryTests.cs index 6962277..37bd9d4 100644 --- a/src/CamlGen.Tests/Elements/Core/QueryTests.cs +++ b/src/CamlGen.Tests/Elements/Core/QueryTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using Shouldly; @@ -43,4 +43,4 @@ public void WhereOnAnQueryReturnsAQueryTagWithANestedWhereTag() sut.ToString().ShouldBe(@""); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/ViewFieldsTests.cs b/src/CamlGen.Tests/Elements/Core/ViewFieldsTests.cs index 2ad6700..f802b70 100644 --- a/src/CamlGen.Tests/Elements/Core/ViewFieldsTests.cs +++ b/src/CamlGen.Tests/Elements/Core/ViewFieldsTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using AutoFixture; @@ -36,7 +36,7 @@ public void AddFieldRefReturnsAViewFieldsTagWithAFieldRef() var name = Fixture.Create(); var sut = new ViewFields(); sut.AddFieldRef(name); - sut.ToString().ShouldBe(string.Format(@"", name)); + sut.ToString().ShouldBe($@""); } [Fact] @@ -47,7 +47,7 @@ public void AddFieldRefWithALambdaReturnsAViewFieldsTagWithAFieldRefAndCallsTheL var attrVal = Fixture.Create(); var sut = new ViewFields(); sut.AddFieldRef(name, r => r.AddAttribute(attrName, attrVal)); - sut.ToString().ShouldBe(string.Format(@"", name, attrName, attrVal)); + sut.ToString().ShouldBe($@""); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/ViewTests.cs b/src/CamlGen.Tests/Elements/Core/ViewTests.cs index a61b15f..a244eb9 100644 --- a/src/CamlGen.Tests/Elements/Core/ViewTests.cs +++ b/src/CamlGen.Tests/Elements/Core/ViewTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using Shouldly; @@ -75,4 +75,4 @@ public void ViewFieldsOnViewReturnsAViewTagWithViewFields() sut.ToString().ShouldBe(@""); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Core/WhereTests.cs b/src/CamlGen.Tests/Elements/Core/WhereTests.cs index 2b06605..926fdd8 100644 --- a/src/CamlGen.Tests/Elements/Core/WhereTests.cs +++ b/src/CamlGen.Tests/Elements/Core/WhereTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using Shouldly; @@ -88,4 +88,4 @@ public void WhereCanAddLeq() sut.ToString().ShouldBe(@""); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Value/BaseValueElementCtorTests.cs b/src/CamlGen.Tests/Elements/Value/BaseValueElementCtorTests.cs index f2ad171..180b810 100644 --- a/src/CamlGen.Tests/Elements/Value/BaseValueElementCtorTests.cs +++ b/src/CamlGen.Tests/Elements/Value/BaseValueElementCtorTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using AutoFixture; @@ -48,4 +48,4 @@ public void CamlTagAttributeReturnsTheTagAndTheAttribute() sut.Object.ToString().ShouldBe(string.Format(@"<{0}>{1}", tag, value)); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Value/BaseValueElementStaticsTests.cs b/src/CamlGen.Tests/Elements/Value/BaseValueElementStaticsTests.cs index 25000d3..e483889 100644 --- a/src/CamlGen.Tests/Elements/Value/BaseValueElementStaticsTests.cs +++ b/src/CamlGen.Tests/Elements/Value/BaseValueElementStaticsTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using Shouldly; @@ -28,4 +28,4 @@ public void GetValueForBoolReturnsTheCorrectWords() BaseValueElement.GetValue(false).ShouldBe("False"); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Value/DatesInUtcTests.cs b/src/CamlGen.Tests/Elements/Value/DatesInUtcTests.cs index 9972ec2..e32cbbd 100644 --- a/src/CamlGen.Tests/Elements/Value/DatesInUtcTests.cs +++ b/src/CamlGen.Tests/Elements/Value/DatesInUtcTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using Shouldly; @@ -31,4 +31,4 @@ public void ExpandUserFieldsWithAFalseValueReturnsFalse() CG.DatesInUtc(false).ToString().ShouldBe("False"); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Value/ExpandUserFieldTests.cs b/src/CamlGen.Tests/Elements/Value/ExpandUserFieldTests.cs index 06c1e72..79816ba 100644 --- a/src/CamlGen.Tests/Elements/Value/ExpandUserFieldTests.cs +++ b/src/CamlGen.Tests/Elements/Value/ExpandUserFieldTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using Shouldly; @@ -31,4 +31,4 @@ public void ExpandUserFieldsWithAFalseValueReturnsFalse() CG.ExpandUserField(false).ToString().ShouldBe("False"); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Value/RowLimitTests.cs b/src/CamlGen.Tests/Elements/Value/RowLimitTests.cs index 7f94986..692b3aa 100644 --- a/src/CamlGen.Tests/Elements/Value/RowLimitTests.cs +++ b/src/CamlGen.Tests/Elements/Value/RowLimitTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using AutoFixture; @@ -29,7 +29,7 @@ public void RowLimitWitANumberPrintsTheRowLimit() var limit = Fixture.Create(); var sut = new RowLimit(limit, null); - sut.ToString().ShouldBe(string.Format("{0}", limit)); + sut.ToString().ShouldBe($"{limit}"); } [Fact] @@ -38,7 +38,7 @@ public void RowLimitPagedWitANumberPrintsTheRowLimit() var limit = Fixture.Create(); var sut = new RowLimit(limit, true); - sut.ToString().ShouldBe(string.Format("{0}", limit)); + sut.ToString().ShouldBe($"{limit}"); } [Fact] @@ -47,7 +47,7 @@ public void RowLimitNotPagedWitANumberPrintsTheRowLimit() var limit = Fixture.Create(); var sut = new RowLimit(limit, false); - sut.ToString().ShouldBe(string.Format("{0}", limit)); + sut.ToString().ShouldBe($"{limit}"); } [Fact] @@ -56,7 +56,7 @@ public void AViewCanSetARowLimit() var limit = Fixture.Create(); var sut = CG.View().RowLimit(limit); - sut.ToString().ShouldBe(string.Format("{0}", limit)); + sut.ToString().ShouldBe($"{limit}"); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Elements/Value/ValueTests.cs b/src/CamlGen.Tests/Elements/Value/ValueTests.cs index 27575a4..d036fa5 100644 --- a/src/CamlGen.Tests/Elements/Value/ValueTests.cs +++ b/src/CamlGen.Tests/Elements/Value/ValueTests.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using AutoFixture; @@ -25,7 +25,7 @@ public class ValueTests : TestBase public void SimpleValueReturnsTag() { var val = Fixture.Create(); - var expected = string.Format(@"{0}", val).AsXml(); + var expected = $@"{val}".AsXml(); var sut = new Val.Value(CG.ValueType.Number, val); sut.ToString().AsXml().ShouldBe(expected); @@ -35,7 +35,7 @@ public void SimpleValueReturnsTag() public void NumberValueReturnsAValueTagWithTypeNumber() { var val = Fixture.Create(); - var expected = string.Format(@"{0}", val).AsXml(); + var expected = $@"{val}".AsXml(); var sut = new Val.NumberValue(val); sut.ToString().AsXml().ShouldBe(expected); @@ -45,7 +45,7 @@ public void NumberValueReturnsAValueTagWithTypeNumber() public void NumberValueUsingTheStringCtorReturnsAValueTagWithTypeNumber() { var val = Fixture.Create(); - var expected = string.Format(@"{0}", val).AsXml(); + var expected = $@"{val}".AsXml(); var sut = new Val.NumberValue(val); sut.ToString().AsXml().ShouldBe(expected); @@ -55,7 +55,7 @@ public void NumberValueUsingTheStringCtorReturnsAValueTagWithTypeNumber() public void NumberValueOnCgReturnsAValueTagWithTypeNumber() { var val = Fixture.Create(); - var expected = string.Format(@"{0}", val).AsXml(); + var expected = $@"{val}".AsXml(); var sut = CG.NumberValue(val); sut.ToString().AsXml().ShouldBe(expected); @@ -65,7 +65,7 @@ public void NumberValueOnCgReturnsAValueTagWithTypeNumber() public void ValueOnCgReturnsAValueTag() { var val = Fixture.Create(); - var expected = string.Format(@"{0}", val).AsXml(); + var expected = $@"{val}".AsXml(); var sut = CG.Value(CG.ValueType.Number, val); sut.ToString().AsXml().ShouldBe(expected); @@ -89,4 +89,4 @@ public void BoolValueFalseReturnsAValueOfZero() sut.ToString().AsXml().ShouldBe(expected); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Features/Feature1.cs b/src/CamlGen.Tests/Features/Feature1.cs index 6d0a2f6..97bf18d 100644 --- a/src/CamlGen.Tests/Features/Feature1.cs +++ b/src/CamlGen.Tests/Features/Feature1.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using Shouldly; using Xunit; @@ -16,7 +16,8 @@ WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. namespace FluentCamlGen.CamlGen.Test.Features { /// - /// 1. Ensure that a join to the "User Information List" is possible, see http://social.msdn.microsoft.com/Forums/de-DE/e5d607fe-b437-4a67-ad9c-5cc5a8284a66/csom-javascript-inner-join-caml-query-on-user-information-list?forum=sharepointdevelopment + /// 1. Ensure that a join to the "User Information List" is possible, + /// see http://social.msdn.microsoft.com/Forums/de-DE/e5d607fe-b437-4a67-ad9c-5cc5a8284a66/csom-javascript-inner-join-caml-query-on-user-information-list?forum=sharepointdevelopment /// public class Feature1 { @@ -91,4 +92,4 @@ public void Feature1PassesFluently() sut.ToString().AsXml().ShouldBe(expected); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Features/Feature2.cs b/src/CamlGen.Tests/Features/Feature2.cs index 14e0314..f3cef67 100644 --- a/src/CamlGen.Tests/Features/Feature2.cs +++ b/src/CamlGen.Tests/Features/Feature2.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using Shouldly; using Xunit; @@ -92,4 +92,4 @@ public void Feature2PassesFluently() sut.ToString().AsXml().ShouldBe(expected); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/Features/Feature3.cs b/src/CamlGen.Tests/Features/Feature3.cs index 629987c..e63f9ad 100644 --- a/src/CamlGen.Tests/Features/Feature3.cs +++ b/src/CamlGen.Tests/Features/Feature3.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using AutoFixture; using Shouldly; @@ -73,4 +73,4 @@ public void GenerateASnippetNewFluentWay() sut.ToString().AsXml().ShouldBe(expected.AsXml()); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/FluentXmlExtensions.cs b/src/CamlGen.Tests/FluentXmlExtensions.cs index d07c27d..741572a 100644 --- a/src/CamlGen.Tests/FluentXmlExtensions.cs +++ b/src/CamlGen.Tests/FluentXmlExtensions.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using System; using System.Collections.Generic; @@ -145,4 +145,4 @@ public int Compare(XElement x, XElement y) } } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/TestBase.cs b/src/CamlGen.Tests/TestBase.cs index ec796e8..dccc16a 100644 --- a/src/CamlGen.Tests/TestBase.cs +++ b/src/CamlGen.Tests/TestBase.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using AutoFixture; @@ -26,4 +26,4 @@ protected TestBase() Fixture.Customize(new TestCgCustomization()); } } -} \ No newline at end of file +} diff --git a/src/CamlGen.Tests/TestCgCustomization.cs b/src/CamlGen.Tests/TestCgCustomization.cs index b5f6b95..06a6925 100644 --- a/src/CamlGen.Tests/TestCgCustomization.cs +++ b/src/CamlGen.Tests/TestCgCustomization.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using AutoFixture; using AutoFixture.Kernel; @@ -42,4 +42,4 @@ private static BaseCoreElement GetCoreElement(ISpecimenBuilder fixture) return fake.Object; } } -} \ No newline at end of file +} diff --git a/src/CamlGen/BaseCoreCompareElementExtensions.cs b/src/CamlGen/BaseCoreCompareElementExtensions.cs index 6a8ad95..b6c331d 100644 --- a/src/CamlGen/BaseCoreCompareElementExtensions.cs +++ b/src/CamlGen/BaseCoreCompareElementExtensions.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,26 +8,26 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ +using System; using FluentCamlGen.CamlGen.Elements.Core; using FluentCamlGen.CamlGen.Elements.Value; -using System; - namespace FluentCamlGen.CamlGen { /// - /// Nice Extensions to work on Compare-Elements + /// Nice Extensions to work on Compare-Elements. /// public static class BaseCoreCompareElementExtensions { /// - /// Add a <FieldRef>-Attribute + /// Add a <FieldRef>-Attribute. /// - /// - /// - /// + /// the extended . + /// The name of the field. + /// The concrete type that is extended. + /// the extended , for fluent re-use. public static T AddFieldRef(this T @this, string name) where T : BaseCoreCompareElement { @@ -35,12 +35,13 @@ public static T AddFieldRef(this T @this, string name) } /// - /// Add a <FieldRef>-Attribute + /// Add a <FieldRef>-Attribute. /// - /// - /// - /// - /// + /// the extended . + /// The name of the field. + /// Fluent configuration of the . + /// The concrete type that is extended. + /// the extended , for fluent re-use. public static T AddFieldRef(this T @this, string name, Action action) where T : BaseCoreCompareElement { @@ -51,12 +52,13 @@ public static T AddFieldRef(this T @this, string name, Action actio } /// - /// Add a <Value>-Attribute + /// Add a <Value>-Attribute. /// - /// - /// - /// - /// + /// the extended . + /// A . + /// The value. + /// The concrete type that is extended. + /// the extended , for fluent re-use. public static T AddValue(this T @this, CG.ValueType type, string value) where T : BaseCoreCompareElement { @@ -64,13 +66,14 @@ public static T AddValue(this T @this, CG.ValueType type, string value) } /// - /// Add a <Value>-Attribute + /// Add a <Value>-Attribute. /// - /// - /// - /// - /// - /// + /// the extended . + /// A . + /// The value. + /// Fluent configuration of the . + /// The concrete type that is extended. + /// the extended , for fluent re-use. public static T AddValue(this T @this, CG.ValueType type, string value, Action action) where T : BaseCoreCompareElement { @@ -81,11 +84,12 @@ public static T AddValue(this T @this, CG.ValueType type, string value, Actio } /// - /// Add a <Value Type="Number">-Attribute + /// Add a <Value Type="Number">-Attribute. /// - /// - /// - /// + /// the extended . + /// The value. + /// The concrete type that is extended. + /// the extended , for fluent re-use. public static T AddNumberValue(this T @this, double value) where T : BaseCoreCompareElement { @@ -93,12 +97,13 @@ public static T AddNumberValue(this T @this, double value) } /// - /// Add a <Value Type="Number">-Attribute + /// Add a <Value Type="Number">-Attribute. /// - /// - /// - /// - /// + /// the extended . + /// The value. + /// Fluent configuration of the . + /// The concrete type that is extended. + /// the extended , for fluent re-use. public static T AddNumberValue(this T @this, double value, Action action) where T : BaseCoreCompareElement { @@ -109,11 +114,12 @@ public static T AddNumberValue(this T @this, double value, Action acti } /// - /// Add a <Value Type="Boolean">-Attribute + /// Add a <Value Type="Boolean">-Attribute. /// - /// - /// - /// + /// the extended . + /// The value. + /// The concrete type that is extended. + /// the extended , for fluent re-use. public static T AddBooleanValue(this T @this, bool value) where T : BaseCoreCompareElement { @@ -121,12 +127,13 @@ public static T AddBooleanValue(this T @this, bool value) } /// - /// Add a <Value Type="Boolean">-Attribute + /// Add a <Value Type="Boolean">-Attribute. /// - /// - /// - /// - /// + /// the extended . + /// The value. + /// Fluent configuration of the . + /// The concrete type that is extended. + /// the extended , for fluent re-use. public static T AddBooleanValue(this T @this, bool value, Action action) where T : BaseCoreCompareElement { @@ -136,4 +143,4 @@ public static T AddBooleanValue(this T @this, bool value, Action actio return @this; } } -} \ No newline at end of file +} diff --git a/src/CamlGen/BaseCoreComparingGroupElementExtensions.cs b/src/CamlGen/BaseCoreComparingGroupElementExtensions.cs index 0a370c3..60b0ae0 100644 --- a/src/CamlGen/BaseCoreComparingGroupElementExtensions.cs +++ b/src/CamlGen/BaseCoreComparingGroupElementExtensions.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,23 +8,24 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ - -using FluentCamlGen.CamlGen.Elements.Core; +*/ using System; +using FluentCamlGen.CamlGen.Elements.Core; namespace FluentCamlGen.CamlGen { /// - /// + /// Nice Extensions to work on ComparingGroup-Elements. /// public static class BaseCoreComparingGroupElementExtensions { /// - /// Add an <Eq>-Tag + /// Add an <Eq>-Tag. /// - /// + /// The extended . + /// The concrete type that is extended. + /// . public static T Eq(this T parent) where T : BaseCoreComparingGroupElement { @@ -32,9 +33,12 @@ public static T Eq(this T parent) } /// - /// Add an <Eq>-Tag + /// Add an <Eq>-Tag. /// - /// + /// The extended . + /// Fluent configuration of the . + /// The concrete type that is extended. + /// . public static T Eq(this T parent, Action action) where T : BaseCoreComparingGroupElement { @@ -45,9 +49,11 @@ public static T Eq(this T parent, Action action) } /// - /// Add a <Neq>-Tag + /// Add a <Neq>-Tag. /// - /// + /// The extended . + /// The concrete type that is extended. + /// . public static T Neq(this T parent) where T : BaseCoreComparingGroupElement { @@ -55,9 +61,12 @@ public static T Neq(this T parent) } /// - /// Add a <Neq>-Tag + /// Add a <Neq>-Tag. /// - /// + /// The extended . + /// Fluent configuration of the . + /// The concrete type that is extended. + /// . public static T Neq(this T parent, Action action) where T : BaseCoreComparingGroupElement { @@ -68,9 +77,11 @@ public static T Neq(this T parent, Action action) } /// - /// Add a <Gt>-Tag + /// Add a <Gt>-Tag. /// - /// + /// The extended . + /// The concrete type that is extended. + /// . public static T Gt(this T parent) where T : BaseCoreComparingGroupElement { @@ -78,9 +89,12 @@ public static T Gt(this T parent) } /// - /// Add a <Gt>-Tag + /// Add a <Gt>-Tag. /// - /// + /// The extended . + /// Fluent configuration of the . + /// The concrete type that is extended. + /// . public static T Gt(this T parent, Action action) where T : BaseCoreComparingGroupElement { @@ -91,9 +105,11 @@ public static T Gt(this T parent, Action action) } /// - /// Add a <Geq>-Tag + /// Add a <Geq>-Tag. /// - /// + /// The extended . + /// The concrete type that is extended. + /// . public static T Geq(this T parent) where T : BaseCoreComparingGroupElement { @@ -101,9 +117,12 @@ public static T Geq(this T parent) } /// - /// Add a <Geq>-Tag + /// Add a <Geq>-Tag. /// - /// + /// The extended . + /// Fluent configuration of the . + /// The concrete type that is extended. + /// . public static T Geq(this T parent, Action action) where T : BaseCoreComparingGroupElement { @@ -114,9 +133,11 @@ public static T Geq(this T parent, Action action) } /// - /// Add a <Lt>-Tag + /// Add a <Lt>-Tag. /// - /// + /// The extended . + /// The concrete type that is extended. + /// . public static T Lt(this T parent) where T : BaseCoreComparingGroupElement { @@ -124,9 +145,12 @@ public static T Lt(this T parent) } /// - /// Add a <Lt>-Tag + /// Add a <Lt>-Tag. /// - /// + /// The extended . + /// Fluent configuration of the . + /// The concrete type that is extended. + /// . public static T Lt(this T parent, Action action) where T : BaseCoreComparingGroupElement { @@ -137,9 +161,11 @@ public static T Lt(this T parent, Action action) } /// - /// Add a <Leq>-Tag + /// Add a <Leq>-Tag. /// - /// + /// The extended . + /// The concrete type that is extended. + /// . public static T Leq(this T parent) where T : BaseCoreComparingGroupElement { @@ -147,9 +173,12 @@ public static T Leq(this T parent) } /// - /// Add a <Leq>-Tag + /// Add a <Leq>-Tag. /// - /// + /// The extended . + /// Fluent configuration of the . + /// The concrete type that is extended. + /// . public static T Leq(this T parent, Action action) where T : BaseCoreComparingGroupElement { @@ -160,9 +189,11 @@ public static T Leq(this T parent, Action action) } /// - /// Add an <And>-Tag + /// Add an <And>-Tag. /// - /// + /// The extended . + /// The concrete type that is extended. + /// . public static T And(this T parent) where T : BaseCoreComparingGroupElement { @@ -170,9 +201,12 @@ public static T And(this T parent) } /// - /// Add an <And>-Tag + /// Add an <And>-Tag. /// - /// + /// The extended . + /// Fluent configuration of the . + /// The concrete type that is extended. + /// . public static T And(this T parent, Action action) where T : BaseCoreComparingGroupElement { @@ -183,9 +217,11 @@ public static T And(this T parent, Action action) } /// - /// Add a nested <Or>-Tag + /// Add a nested <Or>-Tag. /// - /// + /// The extended . + /// The concrete type that is extended. + /// . public static T Or(this T parent) where T : BaseCoreComparingGroupElement { @@ -193,9 +229,12 @@ public static T Or(this T parent) } /// - /// Add a nested <Or>-Tag + /// Add a nested <Or>-Tag. /// - /// + /// The extended . + /// Fluent configuration of the . + /// The concrete type that is extended. + /// . public static T Or(this T parent, Action action) where T : BaseCoreComparingGroupElement { @@ -206,9 +245,11 @@ public static T Or(this T parent, Action action) } /// - /// Add an <Contains>-Tag + /// Add an <Contains>-Tag. /// - /// + /// The extended . + /// The concrete type that is extended. + /// . public static T Contains(this T parent) where T : BaseCoreComparingGroupElement { @@ -216,9 +257,12 @@ public static T Contains(this T parent) } /// - /// Add an <Contains>-Tag + /// Add an <Contains>-Tag. /// - /// + /// The extended . + /// Fluent configuration of the . + /// The concrete type that is extended. + /// . public static T Contains(this T parent, Action action) where T : BaseCoreComparingGroupElement { @@ -228,4 +272,4 @@ public static T Contains(this T parent, Action action) return parent; } } -} \ No newline at end of file +} diff --git a/src/CamlGen/BaseCoreElementExtensions.cs b/src/CamlGen/BaseCoreElementExtensions.cs index fbd4def..87ebea5 100644 --- a/src/CamlGen/BaseCoreElementExtensions.cs +++ b/src/CamlGen/BaseCoreElementExtensions.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,27 +8,26 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ - -using FluentCamlGen.CamlGen.Elements.Core; +*/ using System; +using FluentCamlGen.CamlGen.Elements.Core; namespace FluentCamlGen.CamlGen { /// - /// Extensions on all BaseCoreElements + /// Extensions on all BaseCoreElements. /// public static class BaseCoreElementExtensions { /// - /// Add An Attribute + /// Add An Attribute. /// - /// - /// Attribute Name - /// Attribute Vlaue - /// or subclasses - /// + /// The extended . + /// Attribute Name. + /// Attribute Value. + /// The concrete type that is extended. + /// The extended , for fluent re-use. public static T AddAttribute(this T @this, string name, string value) where T : BaseCoreElement { @@ -36,4 +35,4 @@ public static T AddAttribute(this T @this, string name, string value) return @this; } } -} \ No newline at end of file +} diff --git a/src/CamlGen/CG.cs b/src/CamlGen/CG.cs index 23068f8..8ffce9c 100644 --- a/src/CamlGen/CG.cs +++ b/src/CamlGen/CG.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,352 +8,379 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ +using System; using FluentCamlGen.CamlGen.Elements; using FluentCamlGen.CamlGen.Elements.Core; using FluentCamlGen.CamlGen.Elements.Value; -using System; - namespace FluentCamlGen.CamlGen { /// - /// CamlGenerator - /// See for a caml reference + /// A Caml Generator. + /// See for a caml reference. /// - public class CG + public static class CG { - #region Types - - /// - /// Basclass fro all Types - /// - public abstract class AbstractType - { - private readonly string _type; - - /// - /// Initializes a new instance of the class. - /// - /// The type. - protected AbstractType(string type) - { - _type = type; - } - - /// - /// Converts to string. - /// - /// - /// A that represents this instance. - /// - public override string ToString() - { - return _type; - } - } - - /// - /// possible JoinTypes to add on a Join - /// - public class JoinType : AbstractType - { - private JoinType(string type) - : base(type) - { - } - - /// - /// LEFT - /// - public static readonly JoinType Inner = new JoinType("INNER"); - - /// - /// INNER - /// - public static readonly JoinType Left = new JoinType("LEFT"); - } - /// - /// possible ValueTypes to add on a <Value>-Element + /// Create <View> ... </View> for ViewXml. /// - public class ValueType : AbstractType - { - private ValueType(string type) - : base(type) - { - } - - /// - /// Number - /// - public static readonly ValueType Number = new ValueType("Number"); - - /// - /// Text - /// - public static readonly ValueType Text = new ValueType("Text"); - - /// - /// Boolean - /// - public static readonly ValueType Boolean = new ValueType("Boolean"); - } - - #endregion Types - - /// - /// Create <View> ... </View> for ViewXml - /// - /// + /// Inner elements. + /// . public static View View(params BaseElement[] inner) { return new View(inner); } /// - /// Create <Query> ... </Query> + /// Create <Query> ... </Query>. /// - /// + /// Inner elements. + /// . public static Query Query(params BaseElement[] inner) { return new Query(inner); } /// - /// Create <ViewFields> ... </ViewFields> + /// Create <ViewFields> ... </ViewFields>. /// - /// + /// Inner elements. + /// . public static ViewFields ViewFields(params BaseElement[] inner) { return new ViewFields(inner); } /// - /// Create <ProjectedFields> ... </ProjectedFields> + /// Create <ProjectedFields> ... </ProjectedFields>. /// - /// + /// Inner elements. + /// . public static ProjectedFields ProjectedFields(params BaseElement[] inner) { return new ProjectedFields(inner); } /// - /// Create <Joins> ... </Joins> + /// Create <Joins> ... </Joins>. /// - /// + /// Inner elements. + /// . public static Joins Joins(params BaseElement[] inner) { return new Joins(inner); } /// - /// Create <FieldRef Name="..." ... /> + /// Create <FieldRef Name="..." ... />. /// - /// + /// Name of the field. + /// Additional attributes. + /// . public static FieldRef FieldRef(string name, params Tuple[] additionalAttributes) { return new FieldRef(name, additionalAttributes); } /// - /// Create <Field Name="..." Type="..." List="..." ShowField="..." /> + /// Create <Field Name="..." Type="..." List="..." ShowField="..." />. /// - /// - public static ProjectedField ProjectedField(string name, string type, string list, string showFileld) + /// Name of the joined field. + /// As of SharePoint Foundation 2010, all joins must be based on an existing lookup relation, so Type always has the value "Lookup". + /// Name of the joined list. + /// Internal name of the field that should be shown. + /// . + public static ProjectedField ProjectedField(string name, string type, string list, string showField) { - return new ProjectedField(name, type, list, showFileld); + return new ProjectedField(name, type, list, showField); } /// - /// Create <Join Type="..." ListAlias="..."> + /// Create <Join Type="..." ListAlias="...">. /// - /// + /// Name of the list to join. + /// A . + /// The left hand side of the join. + /// The right hand side of the join. + /// . public static Join Join(string listName, JoinType type, BaseElement lhs, BaseElement rhs) { return new Join(listName, type, lhs, rhs); } /// - /// Create <Join Type="..." ListAlias="..."> + /// Create <Join Type="..." ListAlias="...">. /// - /// + /// Name of the list to join. + /// A . + /// Name of the field to join on. + /// . public static Join Join(string listName, JoinType type, string joinField) { return new Join(listName, type, joinField); } /// - /// Create <Join Type="INNER" ListAlias="..."> + /// Create <Join Type="INNER" ListAlias="...">. /// - /// + /// Name of the list to join. + /// Name of the field to join on. + /// . public static Join InnerJoin(string listName, string joinField) { return Join(listName, JoinType.Inner, joinField); } /// - /// <Eq> ... </Eq> + /// <Eq> ... </Eq>. /// - /// + /// Inner elements. + /// . public static Eq Eq(params BaseElement[] inner) { return new Eq(inner); } /// - /// <QueryOptions> ... </QueryOptions> + /// <QueryOptions> ... </QueryOptions>. /// - /// - /// + /// Inner elements. + /// . public static QueryOptions QueryOptions(params BaseValueElement[] values) { return new QueryOptions(values); } /// - /// <ExpandUserField>True|False</ExpandUserField> + /// <ExpandUserField>True|False</ExpandUserField>. /// - /// - /// + /// true for "True". + /// . public static ExpandUserField ExpandUserField(bool value) { return new ExpandUserField(value); } /// - /// <DatesInUtc>True|False</DatesInUtc> + /// <DatesInUtc>True|False</DatesInUtc>. /// - /// - /// + /// true for "True". + /// . public static DatesInUtc DatesInUtc(bool value) { return new DatesInUtc(value); } /// - /// <Where> ... </Where> + /// <Where> ... </Where>. /// - /// - /// + /// Inner elements. + /// . public static Where Where(params BaseElement[] inner) { return new Where(inner); } /// - /// <And> ... </And> + /// <And> ... </And>. /// - /// - /// + /// Inner elements. + /// . public static And And(params BaseElement[] inner) { return new And(inner); } /// - /// <Value Type="..."> ... </Value> + /// <Value Type="..."> ... </Value>. /// - /// - /// - /// + /// A . + /// The value. + /// . public static Value Value(ValueType type, string value) { return new Value(type, value); } /// - /// <Value Type="Number"> ... </Value> + /// <Value Type="Number"> ... </Value>. /// - /// - /// + /// The number. + /// . public static Value NumberValue(double number) { return new NumberValue(number); } /// - /// <Value Type="Boolean">0|1</Value> + /// <Value Type="Boolean">0|1</Value>. /// - /// - /// + /// true for "True". + /// . public static Value BooleanValue(bool val) { return new BooleanValue(val); } /// - /// <OrderBy> ... </OrderBy> + /// <OrderBy> ... </OrderBy>. /// - /// - /// + /// Inner elements. + /// . public static OrderBy OrderBy(params BaseElement[] inner) { return new OrderBy(inner); } /// - /// <Or> ... </Or> + /// <Or> ... </Or>. /// - /// + /// Inner elements. + /// . public static Or Or(params BaseElement[] inner) { return new Or(inner); } /// - /// <Neq> ... </Neq> + /// <Neq> ... </Neq>. /// - /// + /// Inner elements. + /// . public static Neq Neq(params BaseElement[] inner) { return new Neq(inner); } /// - /// <Lt> ... </Lt> + /// <Lt> ... </Lt>. /// - /// + /// Inner elements. + /// . public static Lt Lt(params BaseElement[] inner) { return new Lt(inner); } /// - /// <Leq> ... </Leq> + /// <Leq> ... </Leq>. /// - /// + /// Inner elements. + /// . public static Leq Leq(params BaseElement[] inner) { return new Leq(inner); } /// - /// <Gt> ... </Gt> + /// <Gt> ... </Gt>. /// - /// + /// Inner elements. + /// . public static Gt Gt(params BaseElement[] inner) { return new Gt(inner); } /// - /// <Geq> ... </Geq> + /// <Geq> ... </Geq>. /// - /// + /// Inner elements. + /// . public static Geq Geq(params BaseElement[] inner) { return new Geq(inner); } /// - /// <Contains> ... </Contains> + /// <Contains> ... </Contains>. /// - /// + /// Inner elements. + /// . public static Contains Contains(params BaseElement[] inner) { return new Contains(inner); } + + #region Types + + /// + /// Baseclass fro all Types. + /// + public abstract class AbstractType + { + private readonly string _type; + + /// + /// Initializes a new instance of the class. + /// + /// The type. + protected AbstractType(string type) + { + _type = type; + } + + /// + /// Converts to string. + /// + /// + /// A that represents this instance. + /// + public override string ToString() + { + return _type; + } + } + + /// + /// possible JoinTypes to add on a Join. + /// + public class JoinType : AbstractType + { + /// + /// LEFT. + /// + public static readonly JoinType Inner = new JoinType("INNER"); + + /// + /// INNER. + /// + public static readonly JoinType Left = new JoinType("LEFT"); + + private JoinType(string type) + : base(type) + { + } + } + + /// + /// possible ValueTypes to add on a <Value>-Element. + /// + public class ValueType : AbstractType + { + /// + /// Number. + /// + public static readonly ValueType Number = new ValueType("Number"); + + /// + /// Text. + /// + public static readonly ValueType Text = new ValueType("Text"); + + /// + /// Boolean. + /// + public static readonly ValueType Boolean = new ValueType("Boolean"); + + private ValueType(string type) + : base(type) + { + } + } + + #endregion Types } -} \ No newline at end of file +} diff --git a/src/CamlGen/CamlGen.csproj b/src/CamlGen/CamlGen.csproj index f7707e2..012da62 100644 --- a/src/CamlGen/CamlGen.csproj +++ b/src/CamlGen/CamlGen.csproj @@ -14,6 +14,7 @@ Nils Andresen MS-PL CAML SharePoint generator fluent + SA1124;SA1309;SA1101;SA1118 bin\Release @@ -26,7 +27,10 @@ 0 - + + + + diff --git a/src/CamlGen/Elements/BaseElement.cs b/src/CamlGen/Elements/BaseElement.cs index 1a80350..8b002e0 100644 --- a/src/CamlGen/Elements/BaseElement.cs +++ b/src/CamlGen/Elements/BaseElement.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ namespace FluentCamlGen.CamlGen.Elements { @@ -18,31 +18,31 @@ namespace FluentCamlGen.CamlGen.Elements public abstract class BaseElement { /// - /// Call this to get the Caml-String + /// Call this to get the Caml-String. /// /// - /// CAML + /// a CAML string. public override string ToString() { return ToString(false, 0); } /// - /// Call this to get the Caml-String + /// Call this to get the Caml-String. /// - /// true, if CAML should be pretty formatted - /// + /// true, if CAML should be pretty formatted. + /// a CAML string. public string ToString(bool formatCaml) { return ToString(formatCaml, 0); } /// - /// Call this to get the Caml-String + /// Call this to get the Caml-String. /// - /// true, if CAML should be pretty formatted + /// true, if CAML should be pretty formatted. /// number of spaces to insert for indentation. - /// + /// a CAML string. public abstract string ToString(bool formatCaml, int indent); } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/And.cs b/src/CamlGen/Elements/Core/And.cs index 83d1c40..2b0ed65 100644 --- a/src/CamlGen/Elements/Core/And.cs +++ b/src/CamlGen/Elements/Core/And.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,13 +8,13 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ namespace FluentCamlGen.CamlGen.Elements.Core { /// /// <And> ... </And> - /// + /// . /// public class And : BaseCoreComparingGroupElement { @@ -23,4 +23,4 @@ internal And(params BaseElement[] operands) { } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/BaseCoreCompareElement.cs b/src/CamlGen/Elements/Core/BaseCoreCompareElement.cs index 2cde70f..ffafc68 100644 --- a/src/CamlGen/Elements/Core/BaseCoreCompareElement.cs +++ b/src/CamlGen/Elements/Core/BaseCoreCompareElement.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ namespace FluentCamlGen.CamlGen.Elements.Core { @@ -16,6 +16,7 @@ namespace FluentCamlGen.CamlGen.Elements.Core /// BaseClass for all comparing elements: /// Eq, Neq, Geq etc. /// + /// Concrete implementing class that inherits from BaseCoreCompareElement. public class BaseCoreCompareElement : BaseCoreElement where T : BaseCoreCompareElement { @@ -24,4 +25,4 @@ internal BaseCoreCompareElement(string name, params BaseElement[] operands) { } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/BaseCoreComparingGroupElement.cs b/src/CamlGen/Elements/Core/BaseCoreComparingGroupElement.cs index b3fe50e..e6e94e6 100644 --- a/src/CamlGen/Elements/Core/BaseCoreComparingGroupElement.cs +++ b/src/CamlGen/Elements/Core/BaseCoreComparingGroupElement.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ namespace FluentCamlGen.CamlGen.Elements.Core { @@ -16,6 +16,7 @@ namespace FluentCamlGen.CamlGen.Elements.Core /// BaseClass for all conainers for comparing elements: /// And, Or, Where /// + /// Concrete implementing class that inherits from BaseCoreComparingGroupElement. public class BaseCoreComparingGroupElement : BaseCoreElement where T : BaseCoreComparingGroupElement { @@ -24,4 +25,4 @@ internal BaseCoreComparingGroupElement(string name, params BaseElement[] operand { } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/BaseCoreElement.cs b/src/CamlGen/Elements/Core/BaseCoreElement.cs index c42d421..4d78d73 100644 --- a/src/CamlGen/Elements/Core/BaseCoreElement.cs +++ b/src/CamlGen/Elements/Core/BaseCoreElement.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using System; using System.Collections.Generic; @@ -22,7 +22,9 @@ namespace FluentCamlGen.CamlGen.Elements.Core public abstract class BaseCoreElement : BaseElement { internal string TagName { get; private set; } + internal IList Childs { get; private set; } + internal IList> Attributes { get; private set; } internal BaseCoreElement(string tagName) @@ -76,26 +78,26 @@ public override string ToString(bool formatCaml, int indent) var nextIndent = formatCaml ? indent + 2 : 0; var sb = new StringBuilder(); - sb.Append(string.Format("{0}<{1}", spaces, TagName)); + sb.Append($"{spaces}<{TagName}"); foreach (var attribute in Attributes) { - sb.Append(string.Format(" {0}=\"{1}\"", attribute.Item1, attribute.Item2)); + sb.Append($" {attribute.Item1}=\"{attribute.Item2}\""); } if (Childs.Count == 0) { - sb.Append(string.Format(" />{0}", newLine)); + sb.Append($" />{newLine}"); } else { - sb.Append(string.Format(">{0}", newLine)); + sb.Append($">{newLine}"); foreach (var cg in Childs) { sb.Append(cg.ToString(formatCaml, nextIndent)); } - sb.Append(string.Format("{0}{2}", spaces, TagName, newLine)); + sb.Append($"{spaces}{newLine}"); } return sb.ToString(); } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/Contains.cs b/src/CamlGen/Elements/Core/Contains.cs index dc34246..6e2c3fc 100644 --- a/src/CamlGen/Elements/Core/Contains.cs +++ b/src/CamlGen/Elements/Core/Contains.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,13 +8,13 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ namespace FluentCamlGen.CamlGen.Elements.Core { /// - /// <Contains> ... </Contains> - /// + /// <Contains> ... </Contains>. + /// /// public class Contains : BaseCoreCompareElement { @@ -23,4 +23,4 @@ internal Contains(params BaseElement[] operands) { } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/Eq.cs b/src/CamlGen/Elements/Core/Eq.cs index c410059..1ba7243 100644 --- a/src/CamlGen/Elements/Core/Eq.cs +++ b/src/CamlGen/Elements/Core/Eq.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,13 +8,13 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ namespace FluentCamlGen.CamlGen.Elements.Core { /// - /// <Eq> ... </Eq> - /// + /// <Eq> ... </Eq>. + /// /// public class Eq : BaseCoreCompareElement { @@ -23,4 +23,4 @@ internal Eq(params BaseElement[] operands) { } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/FieldRef.cs b/src/CamlGen/Elements/Core/FieldRef.cs index 975a06f..23075f0 100644 --- a/src/CamlGen/Elements/Core/FieldRef.cs +++ b/src/CamlGen/Elements/Core/FieldRef.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using System; using System.Collections.Generic; @@ -17,7 +17,8 @@ WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. namespace FluentCamlGen.CamlGen.Elements.Core { /// - /// Create <FieldRef Name="..." ... /> + /// Create <FieldRef Name="..." ... />. + /// /// public class FieldRef : BaseCoreElement { @@ -31,12 +32,13 @@ internal FieldRef(string name, IEnumerable> additionalAttr { } - private static IEnumerable> JoinNameAttr(string name, - IEnumerable> - additionalAttributes) + private static IEnumerable> JoinNameAttr( + string name, + IEnumerable> + additionalAttributes) { return new[] { new Tuple("Name", name) } .Union(additionalAttributes); } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/Geq.cs b/src/CamlGen/Elements/Core/Geq.cs index 7990d4b..1c8bb97 100644 --- a/src/CamlGen/Elements/Core/Geq.cs +++ b/src/CamlGen/Elements/Core/Geq.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,13 +8,13 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ namespace FluentCamlGen.CamlGen.Elements.Core { /// - /// <Geq> ... </Geq> - /// + /// <Geq> ... </Geq>. + /// /// public class Geq : BaseCoreCompareElement { @@ -23,4 +23,4 @@ internal Geq(params BaseElement[] operands) { } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/Gt.cs b/src/CamlGen/Elements/Core/Gt.cs index ffefa72..bb78ec7 100644 --- a/src/CamlGen/Elements/Core/Gt.cs +++ b/src/CamlGen/Elements/Core/Gt.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,13 +8,13 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ namespace FluentCamlGen.CamlGen.Elements.Core { /// - /// <Gt> ... </Gt> - /// + /// <Gt> ... </Gt>. + /// /// public class Gt : BaseCoreCompareElement { @@ -23,4 +23,4 @@ internal Gt(params BaseElement[] operands) { } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/Join.cs b/src/CamlGen/Elements/Core/Join.cs index f8a1de7..d5e77ef 100644 --- a/src/CamlGen/Elements/Core/Join.cs +++ b/src/CamlGen/Elements/Core/Join.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,15 +8,15 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using System; namespace FluentCamlGen.CamlGen.Elements.Core { /// - /// Create <Join Type="INNER" ListAlias="..."> - /// + /// Create <Join Type="INNER" ListAlias="...">. + /// /// public class Join : BaseCoreElement { @@ -37,11 +37,14 @@ internal Join(string listName, CG.JoinType type, BaseElement lhs, BaseElement rh } internal Join(string listName, CG.JoinType type) - : base("Join", new[] + : base( + "Join", + new[] { new Tuple("Type", type.ToString()), - new Tuple("ListAlias", listName) - }, null) + new Tuple("ListAlias", listName), + }, + null) { _innerEq = new Eq(); Childs.Add(_innerEq); @@ -50,12 +53,15 @@ internal Join(string listName, CG.JoinType type) /// /// Add a <FieldRef>-Attribute /// + /// The Field to reference. + /// Fluent configuration of the . + /// Fluent . public Join AddFieldRef(string name, Action action) { _innerEq.AddFieldRef(name, action); return this; } - //TODO: AddValue fehlt + // TODO: AddValue fehlt } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/Joins.cs b/src/CamlGen/Elements/Core/Joins.cs index ce32c15..5fd24ef 100644 --- a/src/CamlGen/Elements/Core/Joins.cs +++ b/src/CamlGen/Elements/Core/Joins.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using System; using System.Collections.Generic; @@ -16,7 +16,8 @@ WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. namespace FluentCamlGen.CamlGen.Elements.Core { /// - /// Create <Joins> ... </Joins> + /// Create <Joins> ... </Joins>. + /// /// public class Joins : BaseCoreElement { @@ -31,9 +32,12 @@ internal Joins(IEnumerable inner) } /// - /// Add Join + /// Add Join. /// - /// Fluent + /// Name of the list to join. + /// A . + /// Fluent configuration of the . + /// Fluent . public Joins AddJoin(string listName, CG.JoinType type, Action action) { var join = new Join(listName, type); @@ -43,24 +47,29 @@ public Joins AddJoin(string listName, CG.JoinType type, Action action) } /// - /// Add Inner-Join + /// Add Inner-Join. /// - /// Fluent - public Joins AddInnerJoin(string listName, string fieldname) + /// Name of the list to join. + /// Name of the field to join on. + /// Fluent . + public Joins AddInnerJoin(string listName, string fieldName) { - return AddInnerJoin(listName, fieldname, x => { }); + return AddInnerJoin(listName, fieldName, x => { }); } /// - /// Add Inner-Join + /// Add Inner-Join. /// - /// Fluent - public Joins AddInnerJoin(string listName, string fieldname, Action action) + /// Name of the list to join. + /// Name of the field to join on. + /// Fluent configuration of the . + /// Fluent . + public Joins AddInnerJoin(string listName, string fieldName, Action action) { - var join = new Join(listName, CG.JoinType.Inner, fieldname); + var join = new Join(listName, CG.JoinType.Inner, fieldName); action(join); Childs.Add(join); return this; } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/Leq.cs b/src/CamlGen/Elements/Core/Leq.cs index 117b991..70c098a 100644 --- a/src/CamlGen/Elements/Core/Leq.cs +++ b/src/CamlGen/Elements/Core/Leq.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,13 +8,13 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ namespace FluentCamlGen.CamlGen.Elements.Core { /// - /// <Leq> ... </Leq> - /// + /// <Leq> ... </Leq>. + /// /// public class Leq : BaseCoreCompareElement { @@ -23,4 +23,4 @@ internal Leq(params BaseElement[] operands) { } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/Lt.cs b/src/CamlGen/Elements/Core/Lt.cs index aedcb65..07362e5 100644 --- a/src/CamlGen/Elements/Core/Lt.cs +++ b/src/CamlGen/Elements/Core/Lt.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,13 +8,13 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ namespace FluentCamlGen.CamlGen.Elements.Core { /// - /// <Lt> ... </Lt> - /// + /// <Lt> ... </Lt>. + /// /// public class Lt : BaseCoreCompareElement { @@ -23,4 +23,4 @@ internal Lt(params BaseElement[] operands) { } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/Neq.cs b/src/CamlGen/Elements/Core/Neq.cs index f008493..c0fc869 100644 --- a/src/CamlGen/Elements/Core/Neq.cs +++ b/src/CamlGen/Elements/Core/Neq.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,13 +8,13 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ namespace FluentCamlGen.CamlGen.Elements.Core { /// - /// <Neq> ... </Neq> - /// + /// <Neq> ... </Neq>. + /// /// public class Neq : BaseCoreCompareElement { @@ -23,4 +23,4 @@ internal Neq(params BaseElement[] operands) { } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/Or.cs b/src/CamlGen/Elements/Core/Or.cs index 1630b76..16f44b7 100644 --- a/src/CamlGen/Elements/Core/Or.cs +++ b/src/CamlGen/Elements/Core/Or.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,13 +8,13 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ namespace FluentCamlGen.CamlGen.Elements.Core { /// - /// <And> ... </And> - /// + /// <Or> ... </Or>. + /// /// public class Or : BaseCoreComparingGroupElement { @@ -23,4 +23,4 @@ internal Or(params BaseElement[] inner) { } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/OrderBy.cs b/src/CamlGen/Elements/Core/OrderBy.cs index b33261c..c91a468 100644 --- a/src/CamlGen/Elements/Core/OrderBy.cs +++ b/src/CamlGen/Elements/Core/OrderBy.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,13 +8,13 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ namespace FluentCamlGen.CamlGen.Elements.Core { /// - /// Create <OrderBy>... </OrderBy> - /// + /// Create <OrderBy>... </OrderBy>. + /// /// public class OrderBy : BaseCoreElement { @@ -24,11 +24,11 @@ internal OrderBy(params BaseElement[] fields) } /// - /// Add a FieldRef + /// Add a FieldRef. /// - /// - /// true, for ascending - /// Fluent + /// Name of the field. + /// true, for ascending. + /// Fluent . public OrderBy AddFieldRef(string name, bool ascending) { var field = new FieldRef(name); @@ -38,23 +38,23 @@ public OrderBy AddFieldRef(string name, bool ascending) } /// - /// Add a FieldRef + /// Add a FieldRef. /// - /// - /// Fluent + /// Name of the field. + /// Fluent . public OrderBy AddFieldRefDescending(string name) { return AddFieldRef(name, false); } /// - /// Add a FieldRef + /// Add a FieldRef. /// - /// - /// Fluent + /// Name of the field. + /// Fluent . public OrderBy AddFieldRefAscending(string name) { return AddFieldRef(name, true); } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/ProjectedField.cs b/src/CamlGen/Elements/Core/ProjectedField.cs index 701995b..d2954b6 100644 --- a/src/CamlGen/Elements/Core/ProjectedField.cs +++ b/src/CamlGen/Elements/Core/ProjectedField.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,27 +8,30 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using System; namespace FluentCamlGen.CamlGen.Elements.Core { /// - /// Create <Field Name="..." Type="..." List="..." ShowField="..." /> + /// Create <Field Name="..." Type="..." List="..." ShowField="..." />. /// public class ProjectedField : BaseCoreElement { - //TODO: Are Params always like this?? - internal ProjectedField(string name, string type, string list, string showFileld) - : base("Field", new[] + // TODO: Are Params always like this?? + internal ProjectedField(string name, string type, string list, string showField) + : base( + "Field", + new[] { new Tuple("Name", name), new Tuple("Type", type), new Tuple("List", list), - new Tuple("ShowField", showFileld) - }, null) + new Tuple("ShowField", showField), + }, + null) { } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/ProjectedFields.cs b/src/CamlGen/Elements/Core/ProjectedFields.cs index 108f696..9a3f1d0 100644 --- a/src/CamlGen/Elements/Core/ProjectedFields.cs +++ b/src/CamlGen/Elements/Core/ProjectedFields.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,14 +8,15 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using System.Collections.Generic; namespace FluentCamlGen.CamlGen.Elements.Core { /// - /// Create <ProjectedFields> ... </ProjectedFields> + /// Create <ProjectedFields> ... </ProjectedFields>. + /// /// public class ProjectedFields : BaseCoreElement { @@ -30,9 +31,13 @@ internal ProjectedFields(IEnumerable inner) } /// - /// Add a (projected) Field + /// Add a (projected) Field. /// - /// Fluent + /// Name of the joined field. + /// As of SharePoint Foundation 2010, all joins must be based on an existing lookup relation, so Type always has the value "Lookup". + /// Name of the joined list. + /// Internal name of the field that should be shown. + /// Fluent . public ProjectedFields AddField(string name, string type, string list, string showField) { var field = new ProjectedField(name, type, list, showField); @@ -40,4 +45,4 @@ public ProjectedFields AddField(string name, string type, string list, string sh return this; } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/Query.cs b/src/CamlGen/Elements/Core/Query.cs index 9819f7e..cdb88ae 100644 --- a/src/CamlGen/Elements/Core/Query.cs +++ b/src/CamlGen/Elements/Core/Query.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using System; using System.Collections.Generic; @@ -16,7 +16,7 @@ WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. namespace FluentCamlGen.CamlGen.Elements.Core { /// - /// Create <Query> ... </Query> + /// Create <Query> ... </Query>. /// public class Query : BaseCoreElement { @@ -31,18 +31,19 @@ internal Query(IEnumerable inner) } /// - /// Add a <Where>-Tag + /// Add a <Where>-Tag. /// - /// + /// . public Query Where() { return Where(x => { }); } /// - /// Add a <Where>-Tag + /// Add a <Where>-Tag. /// - /// + /// Fluent configuration of the . + /// . public Query Where(Action action) { var where = new Where(); @@ -52,9 +53,10 @@ public Query Where(Action action) } /// - /// Add a <OrderBy>-Tag + /// Add a <OrderBy>-Tag. /// - /// + /// Fluent configuration of the . + /// . public Query OrderBy(Action action) { var order = new OrderBy(); @@ -63,4 +65,4 @@ public Query OrderBy(Action action) return this; } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/QueryOptions.cs b/src/CamlGen/Elements/Core/QueryOptions.cs index 239e41c..f478e5d 100644 --- a/src/CamlGen/Elements/Core/QueryOptions.cs +++ b/src/CamlGen/Elements/Core/QueryOptions.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using FluentCamlGen.CamlGen.Elements.Value; @@ -17,22 +17,23 @@ namespace FluentCamlGen.CamlGen.Elements.Core // DO NOT ADD CHILD-CG's OR ATTRIBUTES HERE! /// - /// Create <QueryOptions> ... </QueryOptions> + /// Create <QueryOptions> ... </QueryOptions>. /// public class QueryOptions : BaseCoreElement { /// - /// Create <QueryOptions> ... </QueryOptions> + /// Initializes a new instance of the class. /// - public QueryOptions(params BaseValueElement[] inner) : - base("QueryOptions", null, inner) + /// Additional elements that should appear inside the <QueryOptions>. + public QueryOptions(params BaseValueElement[] inner) + : base("QueryOptions", null, inner) { } /// - /// Add an <ExpandUserFields>-Tag + /// Add an <ExpandUserFields>-Tag. /// - /// + /// the value of the ExpandUserFields. /// public QueryOptions ExpandUserField(bool value) { @@ -41,14 +42,14 @@ public QueryOptions ExpandUserField(bool value) } /// - /// Add an <DatesInUtc>-Tag + /// Add an <DatesInUtc>-Tag. /// - /// - /// + /// the value of the DatesInUtc. + /// . public QueryOptions DatesInUtc(bool value) { Childs.Add(new DatesInUtc(value)); return this; } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/View.cs b/src/CamlGen/Elements/Core/View.cs index eee3cc0..e5a9ae8 100644 --- a/src/CamlGen/Elements/Core/View.cs +++ b/src/CamlGen/Elements/Core/View.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,17 +8,17 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ - -using FluentCamlGen.CamlGen.Elements.Value; +*/ using System; using System.Collections.Generic; +using FluentCamlGen.CamlGen.Elements.Value; namespace FluentCamlGen.CamlGen.Elements.Core { /// - /// Create <View> ... </View> for ViewXml + /// Create <View> ... </View> for ViewXml. + /// /// public class View : BaseCoreElement { @@ -28,18 +28,19 @@ internal View(IEnumerable inner) } /// - /// Add empty Query + /// Add empty Query. /// - /// Fluent + /// Fluent . public View Query() { return Query(x => { }); } /// - /// Add Query + /// Add Query. /// - /// Fluent + /// Fluent configuration of the . + /// Fluent . public View Query(Action action) { var query = new Query(); @@ -49,9 +50,10 @@ public View Query(Action action) } /// - /// Add ViewFields + /// Add ViewFields. /// - /// Fluent + /// Fluent configuration of the . + /// Fluent . public View ViewFields(Action action) { var viewFields = new ViewFields(); @@ -61,9 +63,10 @@ public View ViewFields(Action action) } /// - /// Add ViewFields + /// Add ProjectedFields. /// - /// Fluent + /// Fluent configuration of the . + /// Fluent . public View ProjectedFields(Action action) { var viewFields = new ProjectedFields(); @@ -73,9 +76,10 @@ public View ProjectedFields(Action action) } /// - /// Add Joins + /// Add Joins. /// - /// Fluent + /// Fluent configuration of the . + /// Fluent . public View Joins(Action action) { var joins = new Joins(); @@ -85,9 +89,10 @@ public View Joins(Action action) } /// - /// Add QueryOptions + /// Add QueryOptions. /// - /// Fluent + /// Fluent configuration of the . + /// Fluent . public View QueryOptions(Action action) { var joins = new QueryOptions(); @@ -97,10 +102,11 @@ public View QueryOptions(Action action) } /// - /// Add a RowLimit to this View + /// Add a RowLimit to this View. /// - /// - /// Fluent + /// The RowLimit. + /// a value that represents the Paged-Attribute, or null to omit it. + /// Fluent . public View RowLimit(int rowLimit, bool? paged = null) { var child = new RowLimit(rowLimit, paged); @@ -108,4 +114,4 @@ public View RowLimit(int rowLimit, bool? paged = null) return this; } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/ViewFields.cs b/src/CamlGen/Elements/Core/ViewFields.cs index 5f7978b..cbab2ab 100644 --- a/src/CamlGen/Elements/Core/ViewFields.cs +++ b/src/CamlGen/Elements/Core/ViewFields.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using System; using System.Collections.Generic; @@ -16,7 +16,7 @@ WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. namespace FluentCamlGen.CamlGen.Elements.Core { /// - /// Create <ViewFields> ... </ViewFields> + /// Create <ViewFields> ... </ViewFields>. /// public class ViewFields : BaseCoreElement { @@ -31,18 +31,21 @@ internal ViewFields(IEnumerable inner) } /// - /// Add a FieldRef + /// Add a FieldRef. /// - /// Fluent + /// The name of the field. + /// Fluent . public ViewFields AddFieldRef(string name) { return AddFieldRef(name, x => { }); } /// - /// Add a FieldRef + /// Add a FieldRef. /// - /// Fluent + /// The name of the field. + /// Fluent configuration of the . + /// Fluent . public ViewFields AddFieldRef(string name, Action fieldRefAction) { var fieldRef = new FieldRef(name); @@ -51,4 +54,4 @@ public ViewFields AddFieldRef(string name, Action fieldRefAction) return this; } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Core/Where.cs b/src/CamlGen/Elements/Core/Where.cs index 420c25c..d6db0de 100644 --- a/src/CamlGen/Elements/Core/Where.cs +++ b/src/CamlGen/Elements/Core/Where.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,12 +8,13 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ namespace FluentCamlGen.CamlGen.Elements.Core { /// - /// <Where> ... </Where> + /// <Where> ... </Where>. + /// /// public class Where : BaseCoreComparingGroupElement { @@ -22,4 +23,4 @@ internal Where(params BaseElement[] inner) { } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Value/BaseValueElement.cs b/src/CamlGen/Elements/Value/BaseValueElement.cs index 9cf89b2..c7566dd 100644 --- a/src/CamlGen/Elements/Value/BaseValueElement.cs +++ b/src/CamlGen/Elements/Value/BaseValueElement.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using System; using System.Collections.Generic; @@ -18,13 +18,12 @@ WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. namespace FluentCamlGen.CamlGen.Elements.Value { /// - /// BaseClass for Value-Elements + /// BaseClass for Value-Elements. /// public class BaseValueElement : BaseElement { private readonly string _tagName; private readonly string _value; - internal IList> Attributes { get; private set; } internal BaseValueElement(string tagName, string value) { @@ -33,22 +32,25 @@ internal BaseValueElement(string tagName, string value) _value = value; } + internal IList> Attributes { get; private set; } + /// - /// Call this to get the Caml-String + /// Call this to get the Caml-String. /// - /// true, if CAML should be pretty formatted + /// true, if CAML should be pretty formatted. /// number of spaces to insert for indentation. - /// + /// The CAML string. public override string ToString(bool formatCaml, int indent) { var spaces = new string(' ', indent); var sb = new StringBuilder(); - sb.Append(string.Format("{0}<{1}", spaces, _tagName)); + sb.Append($"{spaces}<{_tagName}"); foreach (var attribute in Attributes) { - sb.Append(string.Format(" {0}=\"{1}\"", attribute.Item1, attribute.Item2)); + sb.Append($" {attribute.Item1}=\"{attribute.Item2}\""); } - sb.Append(string.Format(">{0}", _value, _tagName)); + + sb.Append($">{_value}"); return sb.ToString(); } @@ -63,4 +65,4 @@ internal static string GetValue(double value) return value.ToString(CultureInfo.InvariantCulture); } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Value/BooleanValue.cs b/src/CamlGen/Elements/Value/BooleanValue.cs index e0dbb3d..55ade67 100644 --- a/src/CamlGen/Elements/Value/BooleanValue.cs +++ b/src/CamlGen/Elements/Value/BooleanValue.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,12 +8,12 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ namespace FluentCamlGen.CamlGen.Elements.Value { /// - /// <Value Type="Boolean">-Tag + /// <Value Type="Boolean">-Tag. /// public class BooleanValue : Value { @@ -27,4 +27,4 @@ private static string GetBoolValue(bool value) return value ? "1" : "0"; } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Value/DatesInUtc.cs b/src/CamlGen/Elements/Value/DatesInUtc.cs index b3c1be9..862db4a 100644 --- a/src/CamlGen/Elements/Value/DatesInUtc.cs +++ b/src/CamlGen/Elements/Value/DatesInUtc.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,12 +8,12 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ namespace FluentCamlGen.CamlGen.Elements.Value { /// - /// <DatesInUtc>-Tag + /// <DatesInUtc>-Tag. /// /// public class DatesInUtc : BaseValueElement @@ -23,4 +23,4 @@ internal DatesInUtc(bool value) { } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Value/ExpandUserField.cs b/src/CamlGen/Elements/Value/ExpandUserField.cs index 0c0eeb6..fae876b 100644 --- a/src/CamlGen/Elements/Value/ExpandUserField.cs +++ b/src/CamlGen/Elements/Value/ExpandUserField.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,12 +8,12 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ namespace FluentCamlGen.CamlGen.Elements.Value { /// - /// <ExpandUserField>-Tag + /// <ExpandUserField>-Tag. /// /// public class ExpandUserField : BaseValueElement @@ -23,4 +23,4 @@ internal ExpandUserField(bool value) { } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Value/NumberValue.cs b/src/CamlGen/Elements/Value/NumberValue.cs index b49656f..3e316e8 100644 --- a/src/CamlGen/Elements/Value/NumberValue.cs +++ b/src/CamlGen/Elements/Value/NumberValue.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,12 +8,12 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ namespace FluentCamlGen.CamlGen.Elements.Value { /// - /// <Value Type="Number">-Tag + /// <Value Type="Number">-Tag. /// public class NumberValue : Value { @@ -27,4 +27,4 @@ internal NumberValue(string value) { } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Value/RowLimit.cs b/src/CamlGen/Elements/Value/RowLimit.cs index 7931dbb..9b97200 100644 --- a/src/CamlGen/Elements/Value/RowLimit.cs +++ b/src/CamlGen/Elements/Value/RowLimit.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using System; using System.Globalization; @@ -22,9 +22,9 @@ internal RowLimit(int rowLimit, bool? paged) { if (paged.HasValue) { - var val = paged.Value ? "TRUE" : "FALSE"; - Attributes.Add(new Tuple("Paged", val)); + var val = GetValue(paged.Value); + Attributes.Add(new Tuple("Paged", val)); } } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Elements/Value/Value.cs b/src/CamlGen/Elements/Value/Value.cs index 67d0054..897adca 100644 --- a/src/CamlGen/Elements/Value/Value.cs +++ b/src/CamlGen/Elements/Value/Value.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,14 +8,14 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using System; namespace FluentCamlGen.CamlGen.Elements.Value { /// - /// <Value>-Tag + /// <Value>-Tag. /// public class Value : BaseValueElement { @@ -25,4 +25,4 @@ internal Value(CG.ValueType type, string value) Attributes.Add(new Tuple("Type", type.ToString())); } } -} \ No newline at end of file +} diff --git a/src/CamlGen/Properties/AssemblyInfo.cs b/src/CamlGen/Properties/AssemblyInfo.cs index 7964d57..b8b8e21 100644 --- a/src/CamlGen/Properties/AssemblyInfo.cs +++ b/src/CamlGen/Properties/AssemblyInfo.cs @@ -1,4 +1,4 @@ -/*** +/* This File is part of FluentCamlGen This source is subject to the Microsoft Public License. @@ -8,7 +8,7 @@ All other rights reserved. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -***/ +*/ using System.Reflection; using System.Runtime.CompilerServices; @@ -17,4 +17,4 @@ WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. [assembly: AssemblyTitle("FluentCamlGen.CamlGen")] [assembly: Guid("6224dcad-d3bb-4693-8732-88549b4da5d5")] [assembly: InternalsVisibleTo("FluentCamlGen.CamlGen.Tests")] -[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] \ No newline at end of file +[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] diff --git a/src/FluentCamlGen.sln.DotSettings b/src/FluentCamlGen.sln.DotSettings new file mode 100644 index 0000000..c6a198f --- /dev/null +++ b/src/FluentCamlGen.sln.DotSettings @@ -0,0 +1,2 @@ + + CG \ No newline at end of file diff --git a/src/stylecop.json b/src/stylecop.json new file mode 100644 index 0000000..8c0325c --- /dev/null +++ b/src/stylecop.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", + "settings": { + "indentation": { + "indentationSize": 4, + "tabSize": 4, + "useTabs": false + }, + "orderingRules": { + "usingDirectivesPlacement": "outsideNamespace", + "blankLinesBetweenUsingGroups": "allow", + "systemUsingDirectivesFirst": true + }, + "documentationRules": { + "xmlHeader": false, + "copyrightText": "This File is part of FluentCamlGen\n\nThis source is subject to the Microsoft Public License.\nSee http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.\nAll other rights reserved.\n\nTHIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF ANY KIND,\nEITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.", + "documentInternalElements": false, + "documentPrivateElements": false + } + } +}