diff --git a/CHANGELOG.md b/CHANGELOG.md index 54b876da..21e077eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +- [Dotnet] Fixed code generation for types that accept List as parameters. Constructors were not properly handling null input. [clrudolphi] ### Changed - [Go] Switch to Google's UUID module ([#251](https://github.com/cucumber/messages/pull/251) diff --git a/codegen/templates/dotnet.dotnet.erb b/codegen/templates/dotnet.dotnet.erb index 43ee7dba..b2cd61e6 100644 --- a/codegen/templates/dotnet.dotnet.erb +++ b/codegen/templates/dotnet.dotnet.erb @@ -1,5 +1,5 @@ <%- @schemas.each do |key, schema| -%> -<%= class_name(key) -%>.cs +<%= class_name(key) %>.cs using System; using System.Collections.Generic; @@ -32,21 +32,21 @@ public sealed class <%= class_name(key) %> */ <%- end -%> <%- if isValueType && !required -%> - public Nullable<<%= type_for(class_name(key), property_name, property) -%>> <%= capitalize(property_name) %> { get; private set; } + public Nullable<<%= type_for(class_name(key), property_name, property) %>> <%= capitalize(property_name) %> { get; private set; } <%- else -%> - public <%= type_for(class_name(key), property_name, property) -%> <%= capitalize(property_name) %> { get; private set; } + public <%= type_for(class_name(key), property_name, property) %> <%= capitalize(property_name) %> { get; private set; } <%- end -%> <%- end -%> <%- if (schema['required'] || []).empty? -%> <%- schema['properties'].each do |property_name, property| -%> - public static <%= class_name(key) %> Create(<%= type_for(class_name(key), property_name, property) -%> <%= property_name %>) + public static <%= class_name(key) %> Create(<%= type_for(class_name(key), property_name, property) %> <%= property_name %>) { return new <%= class_name(key) %>( <%- schema['properties'].each.with_index(1) do |(property_name_2, _property_2), index| -%> <%- if property_name_2 == property_name -%> - Require<<%= type_for(class_name(key), property_name, property) -%>>(<%= property_name %>, "<%= capitalize(property_name) %>", "<%= class_name(key) %>.<%= capitalize(property_name) %> cannot be null")<%= index < schema['properties'].length ? ',' : '' %> + Require<<%= type_for(class_name(key), property_name, property) %>>(<%= property_name %>, "<%= capitalize(property_name) %>", "<%= class_name(key) %>.<%= capitalize(property_name) %> cannot be null")<%= index < schema['properties'].length ? ',' : '' %> <%- else -%> null<%= index < schema['properties'].length ? ',' : '' %> <%- end -%> @@ -62,9 +62,9 @@ public sealed class <%= class_name(key) %> required = (schema['required'] || []).index(property_name) -%> <%- if isValueType && !required -%> - Nullable<<%= type_for(class_name(key), property_name, property) -%>> <%= property_name %><%= index < schema['properties'].length ? ',' : ''%> + Nullable<<%= type_for(class_name(key), property_name, property) %>> <%= property_name %><%= index < schema['properties'].length ? ',' : ''%> <%- else -%> - <%= type_for(class_name(key), property_name, property) -%> <%= property_name %><%= index < schema['properties'].length ? ',' : ''%> + <%= type_for(class_name(key), property_name, property) %> <%= property_name %><%= index < schema['properties'].length ? ',' : ''%> <%- end -%> <%- end -%> ) @@ -72,11 +72,15 @@ public sealed class <%= class_name(key) %> <%- schema['properties'].each do |property_name, property| required = (schema['required'] || []).index(property_name) -%> - <% if required -%> - RequireNonNull<<%= type_for(class_name(key), property_name, property) -%>>(<%= property_name %>, "<%= capitalize(property_name) %>", "<%= class_name(key) %>.<%= capitalize(property_name) %> cannot be null"); + <%- if required -%> + RequireNonNull<<%= type_for(class_name(key), property_name, property) %>>(<%= property_name %>, "<%= capitalize(property_name) %>", "<%= class_name(key) %>.<%= capitalize(property_name) %> cannot be null"); <%- end -%> <%- if property['items'] -%> - this.<%= capitalize(property_name) %> = new <%= type_for(class_name(key), property_name, property) -%>(<%= property_name %>); + <%- if required -%> + this.<%= capitalize(property_name) %> = new <%= type_for(class_name(key), property_name, property) %>(<%= property_name %>); + <%- else -%> + this.<%= capitalize(property_name) %> = <%= property_name %> == null ? null : new <%= type_for(class_name(key), property_name, property) %>(<%= property_name %>); + <%- end -%> <%- else -%> this.<%= capitalize(property_name) %> = <%= property_name %>; <%- end -%> @@ -90,9 +94,9 @@ public sealed class <%= class_name(key) %> <%= class_name(key) %> that = (<%= class_name(key) %>) o; return <%- schema['properties'].each.with_index(1) do |(property_name, _property), index| %> <%- if (schema['required'] || []).index(property_name) -%> - <%= capitalize(property_name) -%>.Equals(that.<%= capitalize(property_name) -%>)<%= index < schema['properties'].length ? ' && ' : ';' -%> + <%= capitalize(property_name) %>.Equals(that.<%= capitalize(property_name) %>)<%= index < schema['properties'].length ? ' && ' : ';' -%> <%- else -%> - Object.Equals(<%= capitalize(property_name) -%>, that.<%= capitalize(property_name) -%>)<%= index < schema['properties'].length ? ' && ' : ';' -%> + Object.Equals(<%= capitalize(property_name) %>, that.<%= capitalize(property_name) %>)<%= index < schema['properties'].length ? ' && ' : ';' -%> <%- end -%> <% end %> } @@ -106,15 +110,15 @@ public sealed class <%= class_name(key) %> isEnum = property['enum'] -%> <%- if isEnum -%> - hash = hash * 31 + <%= capitalize(property_name) -%>.GetHashCode(); + hash = hash * 31 + <%= capitalize(property_name) %>.GetHashCode(); <%- elsif isValueType && !required -%> if (<%= capitalize(property_name) -%>.HasValue) - hash = hash * 31 + <%= capitalize(property_name) -%>.Value.GetHashCode(); + hash = hash * 31 + <%= capitalize(property_name) %>.Value.GetHashCode(); <%- elsif isValueType -%> - hash = hash * 31 + <%= capitalize(property_name) -%>.GetHashCode(); + hash = hash * 31 + <%= capitalize(property_name) %>.GetHashCode(); <%- else -%> if (<%= capitalize(property_name) -%> != null) - hash = hash * 31 + <%= capitalize(property_name) -%>.GetHashCode(); + hash = hash * 31 + <%= capitalize(property_name) %>.GetHashCode(); <%- end -%> <%- end -%> return hash; @@ -128,7 +132,7 @@ public sealed class <%= class_name(key) %> isValueType = type_for(class_name(key), property_name, property) == 'long' || type_for(class_name(key), property_name, property) == 'bool' -%> <%- if isValueType && !required -%> - (<%= capitalize(property_name) -%>.HasValue ? "<%= index.zero? ? '' : ', '%><%= property_name %>=" + <%= capitalize(property_name) %>.Value : "") + + (<%= capitalize(property_name) %>.HasValue ? "<%= index.zero? ? '' : ', '%><%= property_name %>=" + <%= capitalize(property_name) %>.Value : "") + <%- else -%> "<%= index.zero? ? '' : ', '%><%= property_name %>=" + <%= capitalize(property_name) %> + <%- end -%> diff --git a/codegen/templates/dotnet.enum.dotnet.erb b/codegen/templates/dotnet.enum.dotnet.erb index ddea7ab8..76b6c2e7 100644 --- a/codegen/templates/dotnet.enum.dotnet.erb +++ b/codegen/templates/dotnet.enum.dotnet.erb @@ -6,7 +6,12 @@ using System.Reflection; namespace Io.Cucumber.Messages.Types; -// Generated code +// ------------------------------------------------------------------------------ +// This code was generated based on the Cucumber JSON schema +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// ------------------------------------------------------------------------------ + public enum <%= enum[:name] %> { <% enum[:values].each.with_index(1) do |value, index| -%> @@ -15,7 +20,7 @@ public enum <%= enum[:name] %> { <% end -%> } -public static class <%= enum[:name] -%>Extensions +public static class <%= enum[:name] %>Extensions { public static string Value(this <%= enum[:name] %> v) { var attribute = v.GetType().GetField(v.ToString()).GetCustomAttribute(); diff --git a/dotnet/.vs/ProjectEvaluation/cucumber.messages.strings.v8.bin b/dotnet/.vs/ProjectEvaluation/cucumber.messages.strings.v8.bin new file mode 100644 index 00000000..4362af7a Binary files /dev/null and b/dotnet/.vs/ProjectEvaluation/cucumber.messages.strings.v8.bin differ diff --git a/dotnet/Cucumber.Messages.Specs/BasicMessageSerializationTests.cs b/dotnet/Cucumber.Messages.Specs/BasicMessageSerializationTests.cs index af4006c0..7085b391 100644 --- a/dotnet/Cucumber.Messages.Specs/BasicMessageSerializationTests.cs +++ b/dotnet/Cucumber.Messages.Specs/BasicMessageSerializationTests.cs @@ -8,6 +8,7 @@ using System; using System.ComponentModel; using Cucumber.Messages; +using System.Linq; namespace Cucumber.Messages.Specs { @@ -32,5 +33,37 @@ public void SerializesAnEnvelopeToNDJSONCorrectly() Assert.Equal(expectedStepDefinition, reconstructedStepDefinition); } + [Fact] + public void ProperlyDeserializesCollectionProperties() { + + // The following is from the CCK hooks sample + var json = @"{""id"":""33"",""pickleId"":""20"",""testSteps"":[{""hookId"":""0"",""id"":""29""},{""hookId"":""1"",""id"":""30""},{""id"":""31"",""pickleStepId"":""19"",""stepDefinitionIds"":[""2""],""stepMatchArgumentsLists"":[{""stepMatchArguments"":[]}]},{""hookId"":""4"",""id"":""32""}]}"; + + // This test will pass if the deserializer does not throw an exception + var testCase = NdjsonSerializer.Deserialize(json); + Assert.Equal(4, testCase.TestSteps.Count); + + var json2 = @"{""id"":""43"",""pickleId"":""24"",""testSteps"":[{""hookId"":""0"",""id"":""39""},{""hookId"":""1"",""id"":""40""},{""id"":""41"",""pickleStepId"":""23"",""stepDefinitionIds"":[],""stepMatchArgumentsLists"":[]},{""hookId"":""4"",""id"":""42""}]}"; + + // This test will pass if the deserializer does not throw an exception + var testCase2 = NdjsonSerializer.Deserialize(json2); + Assert.Equal(4, testCase2.TestSteps.Count); + + var envText = @"{""testCase"":{""id"":""33"",""pickleId"":""20"",""testSteps"":[{""hookId"":""0"",""id"":""29""},{""hookId"":""1"",""id"":""30""},{""id"":""31"",""pickleStepId"":""19"",""stepDefinitionIds"":[""2""],""stepMatchArgumentsLists"":[{""stepMatchArguments"":[]}]},{""hookId"":""4"",""id"":""32""}]}} +{""testCase"":{""id"":""38"",""pickleId"":""22"",""testSteps"":[{""hookId"":""0"",""id"":""34""},{""hookId"":""1"",""id"":""35""},{""id"":""36"",""pickleStepId"":""21"",""stepDefinitionIds"":[""3""],""stepMatchArgumentsLists"":[{""stepMatchArguments"":[]}]},{""hookId"":""4"",""id"":""37""}]}} +{""testCase"":{""id"":""43"",""pickleId"":""24"",""testSteps"":[{""hookId"":""0"",""id"":""39""},{""hookId"":""1"",""id"":""40""},{""id"":""41"",""pickleStepId"":""23"",""stepDefinitionIds"":[],""stepMatchArgumentsLists"":[]},{""hookId"":""4"",""id"":""42""}]}} +{""testCase"":{""id"":""49"",""pickleId"":""26"",""testSteps"":[{""hookId"":""0"",""id"":""44""},{""hookId"":""1"",""id"":""45""},{""id"":""46"",""pickleStepId"":""25"",""stepDefinitionIds"":[""2""],""stepMatchArgumentsLists"":[{""stepMatchArguments"":[]}]},{""hookId"":""5"",""id"":""47""},{""hookId"":""4"",""id"":""48""}]}} +{""testCase"":{""id"":""55"",""pickleId"":""28"",""testSteps"":[{""hookId"":""0"",""id"":""50""},{""hookId"":""1"",""id"":""51""},{""id"":""52"",""pickleStepId"":""27"",""stepDefinitionIds"":[""2""],""stepMatchArgumentsLists"":[{""stepMatchArguments"":[]}]},{""hookId"":""6"",""id"":""53""},{""hookId"":""4"",""id"":""54""}]}}"; + var lines = envText.Replace("\r\n", "\n").Split("\n").ToList(); + + List envelopes = new List(); + + foreach (var line in lines) + { + var envelope = NdjsonSerializer.Deserialize(line); + envelopes.Add(envelope); + } + Assert.Equal(5, envelopes.Count); + } } } diff --git a/dotnet/Cucumber.Messages/generated/Attachment.cs b/dotnet/Cucumber.Messages/generated/Attachment.cs index acb11b5d..40eee186 100644 --- a/dotnet/Cucumber.Messages/generated/Attachment.cs +++ b/dotnet/Cucumber.Messages/generated/Attachment.cs @@ -86,17 +86,17 @@ public Attachment( string url ) { - RequireNonNull(body, "Body", "Attachment.Body cannot be null"); + RequireNonNull(body, "Body", "Attachment.Body cannot be null"); this.Body = body; - RequireNonNull(contentEncoding, "ContentEncoding", "Attachment.ContentEncoding cannot be null"); + RequireNonNull(contentEncoding, "ContentEncoding", "Attachment.ContentEncoding cannot be null"); this.ContentEncoding = contentEncoding; - this.FileName = fileName; - RequireNonNull(mediaType, "MediaType", "Attachment.MediaType cannot be null"); + this.FileName = fileName; + RequireNonNull(mediaType, "MediaType", "Attachment.MediaType cannot be null"); this.MediaType = mediaType; - this.Source = source; - this.TestCaseStartedId = testCaseStartedId; - this.TestStepId = testStepId; - this.Url = url; + this.Source = source; + this.TestCaseStartedId = testCaseStartedId; + this.TestStepId = testStepId; + this.Url = url; } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/AttachmentContentEncoding.cs b/dotnet/Cucumber.Messages/generated/AttachmentContentEncoding.cs index 84f2ca03..8c4198d5 100644 --- a/dotnet/Cucumber.Messages/generated/AttachmentContentEncoding.cs +++ b/dotnet/Cucumber.Messages/generated/AttachmentContentEncoding.cs @@ -4,7 +4,12 @@ namespace Io.Cucumber.Messages.Types; -// Generated code +// ------------------------------------------------------------------------------ +// This code was generated based on the Cucumber JSON schema +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// ------------------------------------------------------------------------------ + public enum AttachmentContentEncoding { [Description("IDENTITY")] diff --git a/dotnet/Cucumber.Messages/generated/Background.cs b/dotnet/Cucumber.Messages/generated/Background.cs index 83bbfd0c..29127063 100644 --- a/dotnet/Cucumber.Messages/generated/Background.cs +++ b/dotnet/Cucumber.Messages/generated/Background.cs @@ -36,17 +36,17 @@ public Background( string id ) { - RequireNonNull(location, "Location", "Background.Location cannot be null"); + RequireNonNull(location, "Location", "Background.Location cannot be null"); this.Location = location; - RequireNonNull(keyword, "Keyword", "Background.Keyword cannot be null"); + RequireNonNull(keyword, "Keyword", "Background.Keyword cannot be null"); this.Keyword = keyword; - RequireNonNull(name, "Name", "Background.Name cannot be null"); + RequireNonNull(name, "Name", "Background.Name cannot be null"); this.Name = name; - RequireNonNull(description, "Description", "Background.Description cannot be null"); + RequireNonNull(description, "Description", "Background.Description cannot be null"); this.Description = description; - RequireNonNull>(steps, "Steps", "Background.Steps cannot be null"); - this.Steps = new List(steps); - RequireNonNull(id, "Id", "Background.Id cannot be null"); + RequireNonNull>(steps, "Steps", "Background.Steps cannot be null"); + this.Steps = new List(steps); + RequireNonNull(id, "Id", "Background.Id cannot be null"); this.Id = id; } diff --git a/dotnet/Cucumber.Messages/generated/Ci.cs b/dotnet/Cucumber.Messages/generated/Ci.cs index 8275b29c..0ee32e37 100644 --- a/dotnet/Cucumber.Messages/generated/Ci.cs +++ b/dotnet/Cucumber.Messages/generated/Ci.cs @@ -40,11 +40,11 @@ public Ci( Git git ) { - RequireNonNull(name, "Name", "Ci.Name cannot be null"); + RequireNonNull(name, "Name", "Ci.Name cannot be null"); this.Name = name; - this.Url = url; - this.BuildNumber = buildNumber; - this.Git = git; + this.Url = url; + this.BuildNumber = buildNumber; + this.Git = git; } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/Comment.cs b/dotnet/Cucumber.Messages/generated/Comment.cs index c55601f9..4d26ca87 100644 --- a/dotnet/Cucumber.Messages/generated/Comment.cs +++ b/dotnet/Cucumber.Messages/generated/Comment.cs @@ -33,9 +33,9 @@ public Comment( string text ) { - RequireNonNull(location, "Location", "Comment.Location cannot be null"); + RequireNonNull(location, "Location", "Comment.Location cannot be null"); this.Location = location; - RequireNonNull(text, "Text", "Comment.Text cannot be null"); + RequireNonNull(text, "Text", "Comment.Text cannot be null"); this.Text = text; } diff --git a/dotnet/Cucumber.Messages/generated/DataTable.cs b/dotnet/Cucumber.Messages/generated/DataTable.cs index 891fc8f6..2bf26aae 100644 --- a/dotnet/Cucumber.Messages/generated/DataTable.cs +++ b/dotnet/Cucumber.Messages/generated/DataTable.cs @@ -25,10 +25,10 @@ public DataTable( List rows ) { - RequireNonNull(location, "Location", "DataTable.Location cannot be null"); + RequireNonNull(location, "Location", "DataTable.Location cannot be null"); this.Location = location; - RequireNonNull>(rows, "Rows", "DataTable.Rows cannot be null"); - this.Rows = new List(rows); + RequireNonNull>(rows, "Rows", "DataTable.Rows cannot be null"); + this.Rows = new List(rows); } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/DocString.cs b/dotnet/Cucumber.Messages/generated/DocString.cs index f24d9cda..6955b1e9 100644 --- a/dotnet/Cucumber.Messages/generated/DocString.cs +++ b/dotnet/Cucumber.Messages/generated/DocString.cs @@ -29,12 +29,12 @@ public DocString( string delimiter ) { - RequireNonNull(location, "Location", "DocString.Location cannot be null"); + RequireNonNull(location, "Location", "DocString.Location cannot be null"); this.Location = location; - this.MediaType = mediaType; - RequireNonNull(content, "Content", "DocString.Content cannot be null"); + this.MediaType = mediaType; + RequireNonNull(content, "Content", "DocString.Content cannot be null"); this.Content = content; - RequireNonNull(delimiter, "Delimiter", "DocString.Delimiter cannot be null"); + RequireNonNull(delimiter, "Delimiter", "DocString.Delimiter cannot be null"); this.Delimiter = delimiter; } diff --git a/dotnet/Cucumber.Messages/generated/Duration.cs b/dotnet/Cucumber.Messages/generated/Duration.cs index 4bc3e46f..af4bb358 100644 --- a/dotnet/Cucumber.Messages/generated/Duration.cs +++ b/dotnet/Cucumber.Messages/generated/Duration.cs @@ -34,9 +34,9 @@ public Duration( long nanos ) { - RequireNonNull(seconds, "Seconds", "Duration.Seconds cannot be null"); + RequireNonNull(seconds, "Seconds", "Duration.Seconds cannot be null"); this.Seconds = seconds; - RequireNonNull(nanos, "Nanos", "Duration.Nanos cannot be null"); + RequireNonNull(nanos, "Nanos", "Duration.Nanos cannot be null"); this.Nanos = nanos; } diff --git a/dotnet/Cucumber.Messages/generated/Envelope.cs b/dotnet/Cucumber.Messages/generated/Envelope.cs index 8c193a40..cf9a0340 100644 --- a/dotnet/Cucumber.Messages/generated/Envelope.cs +++ b/dotnet/Cucumber.Messages/generated/Envelope.cs @@ -453,23 +453,23 @@ public Envelope( UndefinedParameterType undefinedParameterType ) { - this.Attachment = attachment; - this.GherkinDocument = gherkinDocument; - this.Hook = hook; - this.Meta = meta; - this.ParameterType = parameterType; - this.ParseError = parseError; - this.Pickle = pickle; - this.Source = source; - this.StepDefinition = stepDefinition; - this.TestCase = testCase; - this.TestCaseFinished = testCaseFinished; - this.TestCaseStarted = testCaseStarted; - this.TestRunFinished = testRunFinished; - this.TestRunStarted = testRunStarted; - this.TestStepFinished = testStepFinished; - this.TestStepStarted = testStepStarted; - this.UndefinedParameterType = undefinedParameterType; + this.Attachment = attachment; + this.GherkinDocument = gherkinDocument; + this.Hook = hook; + this.Meta = meta; + this.ParameterType = parameterType; + this.ParseError = parseError; + this.Pickle = pickle; + this.Source = source; + this.StepDefinition = stepDefinition; + this.TestCase = testCase; + this.TestCaseFinished = testCaseFinished; + this.TestCaseStarted = testCaseStarted; + this.TestRunFinished = testRunFinished; + this.TestRunStarted = testRunStarted; + this.TestStepFinished = testStepFinished; + this.TestStepStarted = testStepStarted; + this.UndefinedParameterType = undefinedParameterType; } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/Examples.cs b/dotnet/Cucumber.Messages/generated/Examples.cs index 768c36d4..babec769 100644 --- a/dotnet/Cucumber.Messages/generated/Examples.cs +++ b/dotnet/Cucumber.Messages/generated/Examples.cs @@ -40,20 +40,20 @@ public Examples( string id ) { - RequireNonNull(location, "Location", "Examples.Location cannot be null"); + RequireNonNull(location, "Location", "Examples.Location cannot be null"); this.Location = location; - RequireNonNull>(tags, "Tags", "Examples.Tags cannot be null"); - this.Tags = new List(tags); - RequireNonNull(keyword, "Keyword", "Examples.Keyword cannot be null"); + RequireNonNull>(tags, "Tags", "Examples.Tags cannot be null"); + this.Tags = new List(tags); + RequireNonNull(keyword, "Keyword", "Examples.Keyword cannot be null"); this.Keyword = keyword; - RequireNonNull(name, "Name", "Examples.Name cannot be null"); + RequireNonNull(name, "Name", "Examples.Name cannot be null"); this.Name = name; - RequireNonNull(description, "Description", "Examples.Description cannot be null"); + RequireNonNull(description, "Description", "Examples.Description cannot be null"); this.Description = description; - this.TableHeader = tableHeader; - RequireNonNull>(tableBody, "TableBody", "Examples.TableBody cannot be null"); - this.TableBody = new List(tableBody); - RequireNonNull(id, "Id", "Examples.Id cannot be null"); + this.TableHeader = tableHeader; + RequireNonNull>(tableBody, "TableBody", "Examples.TableBody cannot be null"); + this.TableBody = new List(tableBody); + RequireNonNull(id, "Id", "Examples.Id cannot be null"); this.Id = id; } diff --git a/dotnet/Cucumber.Messages/generated/Exception.cs b/dotnet/Cucumber.Messages/generated/Exception.cs index 106245ed..cbc9b347 100644 --- a/dotnet/Cucumber.Messages/generated/Exception.cs +++ b/dotnet/Cucumber.Messages/generated/Exception.cs @@ -38,10 +38,10 @@ public Exception( string stackTrace ) { - RequireNonNull(type, "Type", "Exception.Type cannot be null"); + RequireNonNull(type, "Type", "Exception.Type cannot be null"); this.Type = type; - this.Message = message; - this.StackTrace = stackTrace; + this.Message = message; + this.StackTrace = stackTrace; } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/Feature.cs b/dotnet/Cucumber.Messages/generated/Feature.cs index 8d1ae1de..0d673b1e 100644 --- a/dotnet/Cucumber.Messages/generated/Feature.cs +++ b/dotnet/Cucumber.Messages/generated/Feature.cs @@ -56,20 +56,20 @@ public Feature( List children ) { - RequireNonNull(location, "Location", "Feature.Location cannot be null"); + RequireNonNull(location, "Location", "Feature.Location cannot be null"); this.Location = location; - RequireNonNull>(tags, "Tags", "Feature.Tags cannot be null"); - this.Tags = new List(tags); - RequireNonNull(language, "Language", "Feature.Language cannot be null"); + RequireNonNull>(tags, "Tags", "Feature.Tags cannot be null"); + this.Tags = new List(tags); + RequireNonNull(language, "Language", "Feature.Language cannot be null"); this.Language = language; - RequireNonNull(keyword, "Keyword", "Feature.Keyword cannot be null"); + RequireNonNull(keyword, "Keyword", "Feature.Keyword cannot be null"); this.Keyword = keyword; - RequireNonNull(name, "Name", "Feature.Name cannot be null"); + RequireNonNull(name, "Name", "Feature.Name cannot be null"); this.Name = name; - RequireNonNull(description, "Description", "Feature.Description cannot be null"); + RequireNonNull(description, "Description", "Feature.Description cannot be null"); this.Description = description; - RequireNonNull>(children, "Children", "Feature.Children cannot be null"); - this.Children = new List(children); + RequireNonNull>(children, "Children", "Feature.Children cannot be null"); + this.Children = new List(children); } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/FeatureChild.cs b/dotnet/Cucumber.Messages/generated/FeatureChild.cs index 77b86b88..b70ad069 100644 --- a/dotnet/Cucumber.Messages/generated/FeatureChild.cs +++ b/dotnet/Cucumber.Messages/generated/FeatureChild.cs @@ -56,9 +56,9 @@ public FeatureChild( Scenario scenario ) { - this.Rule = rule; - this.Background = background; - this.Scenario = scenario; + this.Rule = rule; + this.Background = background; + this.Scenario = scenario; } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/GherkinDocument.cs b/dotnet/Cucumber.Messages/generated/GherkinDocument.cs index 162c5e51..68b1f190 100644 --- a/dotnet/Cucumber.Messages/generated/GherkinDocument.cs +++ b/dotnet/Cucumber.Messages/generated/GherkinDocument.cs @@ -41,10 +41,10 @@ public GherkinDocument( List comments ) { - this.Uri = uri; - this.Feature = feature; - RequireNonNull>(comments, "Comments", "GherkinDocument.Comments cannot be null"); - this.Comments = new List(comments); + this.Uri = uri; + this.Feature = feature; + RequireNonNull>(comments, "Comments", "GherkinDocument.Comments cannot be null"); + this.Comments = new List(comments); } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/Git.cs b/dotnet/Cucumber.Messages/generated/Git.cs index 08e160a3..7d0fc986 100644 --- a/dotnet/Cucumber.Messages/generated/Git.cs +++ b/dotnet/Cucumber.Messages/generated/Git.cs @@ -32,12 +32,12 @@ public Git( string tag ) { - RequireNonNull(remote, "Remote", "Git.Remote cannot be null"); + RequireNonNull(remote, "Remote", "Git.Remote cannot be null"); this.Remote = remote; - RequireNonNull(revision, "Revision", "Git.Revision cannot be null"); + RequireNonNull(revision, "Revision", "Git.Revision cannot be null"); this.Revision = revision; - this.Branch = branch; - this.Tag = tag; + this.Branch = branch; + this.Tag = tag; } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/Group.cs b/dotnet/Cucumber.Messages/generated/Group.cs index eedde3c6..b97270f1 100644 --- a/dotnet/Cucumber.Messages/generated/Group.cs +++ b/dotnet/Cucumber.Messages/generated/Group.cs @@ -27,10 +27,10 @@ public Group( string value ) { - RequireNonNull>(children, "Children", "Group.Children cannot be null"); - this.Children = new List(children); - this.Start = start; - this.Value = value; + RequireNonNull>(children, "Children", "Group.Children cannot be null"); + this.Children = new List(children); + this.Start = start; + this.Value = value; } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/Hook.cs b/dotnet/Cucumber.Messages/generated/Hook.cs index 4c5e5c77..48249f1e 100644 --- a/dotnet/Cucumber.Messages/generated/Hook.cs +++ b/dotnet/Cucumber.Messages/generated/Hook.cs @@ -29,12 +29,12 @@ public Hook( string tagExpression ) { - RequireNonNull(id, "Id", "Hook.Id cannot be null"); + RequireNonNull(id, "Id", "Hook.Id cannot be null"); this.Id = id; - this.Name = name; - RequireNonNull(sourceReference, "SourceReference", "Hook.SourceReference cannot be null"); + this.Name = name; + RequireNonNull(sourceReference, "SourceReference", "Hook.SourceReference cannot be null"); this.SourceReference = sourceReference; - this.TagExpression = tagExpression; + this.TagExpression = tagExpression; } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/JavaMethod.cs b/dotnet/Cucumber.Messages/generated/JavaMethod.cs index b8284942..efee9515 100644 --- a/dotnet/Cucumber.Messages/generated/JavaMethod.cs +++ b/dotnet/Cucumber.Messages/generated/JavaMethod.cs @@ -27,12 +27,12 @@ public JavaMethod( List methodParameterTypes ) { - RequireNonNull(className, "ClassName", "JavaMethod.ClassName cannot be null"); + RequireNonNull(className, "ClassName", "JavaMethod.ClassName cannot be null"); this.ClassName = className; - RequireNonNull(methodName, "MethodName", "JavaMethod.MethodName cannot be null"); + RequireNonNull(methodName, "MethodName", "JavaMethod.MethodName cannot be null"); this.MethodName = methodName; - RequireNonNull>(methodParameterTypes, "MethodParameterTypes", "JavaMethod.MethodParameterTypes cannot be null"); - this.MethodParameterTypes = new List(methodParameterTypes); + RequireNonNull>(methodParameterTypes, "MethodParameterTypes", "JavaMethod.MethodParameterTypes cannot be null"); + this.MethodParameterTypes = new List(methodParameterTypes); } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/JavaStackTraceElement.cs b/dotnet/Cucumber.Messages/generated/JavaStackTraceElement.cs index 6c4276de..fbaf9cc9 100644 --- a/dotnet/Cucumber.Messages/generated/JavaStackTraceElement.cs +++ b/dotnet/Cucumber.Messages/generated/JavaStackTraceElement.cs @@ -27,11 +27,11 @@ public JavaStackTraceElement( string methodName ) { - RequireNonNull(className, "ClassName", "JavaStackTraceElement.ClassName cannot be null"); + RequireNonNull(className, "ClassName", "JavaStackTraceElement.ClassName cannot be null"); this.ClassName = className; - RequireNonNull(fileName, "FileName", "JavaStackTraceElement.FileName cannot be null"); + RequireNonNull(fileName, "FileName", "JavaStackTraceElement.FileName cannot be null"); this.FileName = fileName; - RequireNonNull(methodName, "MethodName", "JavaStackTraceElement.MethodName cannot be null"); + RequireNonNull(methodName, "MethodName", "JavaStackTraceElement.MethodName cannot be null"); this.MethodName = methodName; } diff --git a/dotnet/Cucumber.Messages/generated/Location.cs b/dotnet/Cucumber.Messages/generated/Location.cs index ef935bd3..f06d9e5c 100644 --- a/dotnet/Cucumber.Messages/generated/Location.cs +++ b/dotnet/Cucumber.Messages/generated/Location.cs @@ -27,9 +27,9 @@ public Location( Nullable column ) { - RequireNonNull(line, "Line", "Location.Line cannot be null"); + RequireNonNull(line, "Line", "Location.Line cannot be null"); this.Line = line; - this.Column = column; + this.Column = column; } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/Meta.cs b/dotnet/Cucumber.Messages/generated/Meta.cs index 0116baa1..7d95337d 100644 --- a/dotnet/Cucumber.Messages/generated/Meta.cs +++ b/dotnet/Cucumber.Messages/generated/Meta.cs @@ -51,17 +51,17 @@ public Meta( Ci ci ) { - RequireNonNull(protocolVersion, "ProtocolVersion", "Meta.ProtocolVersion cannot be null"); + RequireNonNull(protocolVersion, "ProtocolVersion", "Meta.ProtocolVersion cannot be null"); this.ProtocolVersion = protocolVersion; - RequireNonNull(implementation, "Implementation", "Meta.Implementation cannot be null"); + RequireNonNull(implementation, "Implementation", "Meta.Implementation cannot be null"); this.Implementation = implementation; - RequireNonNull(runtime, "Runtime", "Meta.Runtime cannot be null"); + RequireNonNull(runtime, "Runtime", "Meta.Runtime cannot be null"); this.Runtime = runtime; - RequireNonNull(os, "Os", "Meta.Os cannot be null"); + RequireNonNull(os, "Os", "Meta.Os cannot be null"); this.Os = os; - RequireNonNull(cpu, "Cpu", "Meta.Cpu cannot be null"); + RequireNonNull(cpu, "Cpu", "Meta.Cpu cannot be null"); this.Cpu = cpu; - this.Ci = ci; + this.Ci = ci; } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/ParameterType.cs b/dotnet/Cucumber.Messages/generated/ParameterType.cs index be0c64ae..cb339e2c 100644 --- a/dotnet/Cucumber.Messages/generated/ParameterType.cs +++ b/dotnet/Cucumber.Messages/generated/ParameterType.cs @@ -36,17 +36,17 @@ public ParameterType( SourceReference sourceReference ) { - RequireNonNull(name, "Name", "ParameterType.Name cannot be null"); + RequireNonNull(name, "Name", "ParameterType.Name cannot be null"); this.Name = name; - RequireNonNull>(regularExpressions, "RegularExpressions", "ParameterType.RegularExpressions cannot be null"); - this.RegularExpressions = new List(regularExpressions); - RequireNonNull(preferForRegularExpressionMatch, "PreferForRegularExpressionMatch", "ParameterType.PreferForRegularExpressionMatch cannot be null"); + RequireNonNull>(regularExpressions, "RegularExpressions", "ParameterType.RegularExpressions cannot be null"); + this.RegularExpressions = new List(regularExpressions); + RequireNonNull(preferForRegularExpressionMatch, "PreferForRegularExpressionMatch", "ParameterType.PreferForRegularExpressionMatch cannot be null"); this.PreferForRegularExpressionMatch = preferForRegularExpressionMatch; - RequireNonNull(useForSnippets, "UseForSnippets", "ParameterType.UseForSnippets cannot be null"); + RequireNonNull(useForSnippets, "UseForSnippets", "ParameterType.UseForSnippets cannot be null"); this.UseForSnippets = useForSnippets; - RequireNonNull(id, "Id", "ParameterType.Id cannot be null"); + RequireNonNull(id, "Id", "ParameterType.Id cannot be null"); this.Id = id; - this.SourceReference = sourceReference; + this.SourceReference = sourceReference; } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/ParseError.cs b/dotnet/Cucumber.Messages/generated/ParseError.cs index 68cac6ff..dde171fe 100644 --- a/dotnet/Cucumber.Messages/generated/ParseError.cs +++ b/dotnet/Cucumber.Messages/generated/ParseError.cs @@ -25,9 +25,9 @@ public ParseError( string message ) { - RequireNonNull(source, "Source", "ParseError.Source cannot be null"); + RequireNonNull(source, "Source", "ParseError.Source cannot be null"); this.Source = source; - RequireNonNull(message, "Message", "ParseError.Message cannot be null"); + RequireNonNull(message, "Message", "ParseError.Message cannot be null"); this.Message = message; } diff --git a/dotnet/Cucumber.Messages/generated/Pickle.cs b/dotnet/Cucumber.Messages/generated/Pickle.cs index dddf1203..e96855e6 100644 --- a/dotnet/Cucumber.Messages/generated/Pickle.cs +++ b/dotnet/Cucumber.Messages/generated/Pickle.cs @@ -72,20 +72,20 @@ public Pickle( List astNodeIds ) { - RequireNonNull(id, "Id", "Pickle.Id cannot be null"); + RequireNonNull(id, "Id", "Pickle.Id cannot be null"); this.Id = id; - RequireNonNull(uri, "Uri", "Pickle.Uri cannot be null"); + RequireNonNull(uri, "Uri", "Pickle.Uri cannot be null"); this.Uri = uri; - RequireNonNull(name, "Name", "Pickle.Name cannot be null"); + RequireNonNull(name, "Name", "Pickle.Name cannot be null"); this.Name = name; - RequireNonNull(language, "Language", "Pickle.Language cannot be null"); + RequireNonNull(language, "Language", "Pickle.Language cannot be null"); this.Language = language; - RequireNonNull>(steps, "Steps", "Pickle.Steps cannot be null"); - this.Steps = new List(steps); - RequireNonNull>(tags, "Tags", "Pickle.Tags cannot be null"); - this.Tags = new List(tags); - RequireNonNull>(astNodeIds, "AstNodeIds", "Pickle.AstNodeIds cannot be null"); - this.AstNodeIds = new List(astNodeIds); + RequireNonNull>(steps, "Steps", "Pickle.Steps cannot be null"); + this.Steps = new List(steps); + RequireNonNull>(tags, "Tags", "Pickle.Tags cannot be null"); + this.Tags = new List(tags); + RequireNonNull>(astNodeIds, "AstNodeIds", "Pickle.AstNodeIds cannot be null"); + this.AstNodeIds = new List(astNodeIds); } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/PickleDocString.cs b/dotnet/Cucumber.Messages/generated/PickleDocString.cs index 8afc2da5..bf800f9a 100644 --- a/dotnet/Cucumber.Messages/generated/PickleDocString.cs +++ b/dotnet/Cucumber.Messages/generated/PickleDocString.cs @@ -25,8 +25,8 @@ public PickleDocString( string content ) { - this.MediaType = mediaType; - RequireNonNull(content, "Content", "PickleDocString.Content cannot be null"); + this.MediaType = mediaType; + RequireNonNull(content, "Content", "PickleDocString.Content cannot be null"); this.Content = content; } diff --git a/dotnet/Cucumber.Messages/generated/PickleStep.cs b/dotnet/Cucumber.Messages/generated/PickleStep.cs index b55028a1..81d4723b 100644 --- a/dotnet/Cucumber.Messages/generated/PickleStep.cs +++ b/dotnet/Cucumber.Messages/generated/PickleStep.cs @@ -45,13 +45,13 @@ public PickleStep( string text ) { - this.Argument = argument; - RequireNonNull>(astNodeIds, "AstNodeIds", "PickleStep.AstNodeIds cannot be null"); - this.AstNodeIds = new List(astNodeIds); - RequireNonNull(id, "Id", "PickleStep.Id cannot be null"); + this.Argument = argument; + RequireNonNull>(astNodeIds, "AstNodeIds", "PickleStep.AstNodeIds cannot be null"); + this.AstNodeIds = new List(astNodeIds); + RequireNonNull(id, "Id", "PickleStep.Id cannot be null"); this.Id = id; - this.Type = type; - RequireNonNull(text, "Text", "PickleStep.Text cannot be null"); + this.Type = type; + RequireNonNull(text, "Text", "PickleStep.Text cannot be null"); this.Text = text; } diff --git a/dotnet/Cucumber.Messages/generated/PickleStepArgument.cs b/dotnet/Cucumber.Messages/generated/PickleStepArgument.cs index 81201941..a1915f71 100644 --- a/dotnet/Cucumber.Messages/generated/PickleStepArgument.cs +++ b/dotnet/Cucumber.Messages/generated/PickleStepArgument.cs @@ -43,8 +43,8 @@ public PickleStepArgument( PickleTable dataTable ) { - this.DocString = docString; - this.DataTable = dataTable; + this.DocString = docString; + this.DataTable = dataTable; } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/PickleStepType.cs b/dotnet/Cucumber.Messages/generated/PickleStepType.cs index 4c064362..f75c6a74 100644 --- a/dotnet/Cucumber.Messages/generated/PickleStepType.cs +++ b/dotnet/Cucumber.Messages/generated/PickleStepType.cs @@ -4,7 +4,12 @@ namespace Io.Cucumber.Messages.Types; -// Generated code +// ------------------------------------------------------------------------------ +// This code was generated based on the Cucumber JSON schema +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// ------------------------------------------------------------------------------ + public enum PickleStepType { [Description("Unknown")] diff --git a/dotnet/Cucumber.Messages/generated/PickleTable.cs b/dotnet/Cucumber.Messages/generated/PickleTable.cs index cc68ac1b..548cae49 100644 --- a/dotnet/Cucumber.Messages/generated/PickleTable.cs +++ b/dotnet/Cucumber.Messages/generated/PickleTable.cs @@ -23,8 +23,8 @@ public PickleTable( List rows ) { - RequireNonNull>(rows, "Rows", "PickleTable.Rows cannot be null"); - this.Rows = new List(rows); + RequireNonNull>(rows, "Rows", "PickleTable.Rows cannot be null"); + this.Rows = new List(rows); } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/PickleTableCell.cs b/dotnet/Cucumber.Messages/generated/PickleTableCell.cs index cc850abe..f2d06202 100644 --- a/dotnet/Cucumber.Messages/generated/PickleTableCell.cs +++ b/dotnet/Cucumber.Messages/generated/PickleTableCell.cs @@ -23,7 +23,7 @@ public PickleTableCell( string value ) { - RequireNonNull(value, "Value", "PickleTableCell.Value cannot be null"); + RequireNonNull(value, "Value", "PickleTableCell.Value cannot be null"); this.Value = value; } diff --git a/dotnet/Cucumber.Messages/generated/PickleTableRow.cs b/dotnet/Cucumber.Messages/generated/PickleTableRow.cs index 121050ff..cd06cebe 100644 --- a/dotnet/Cucumber.Messages/generated/PickleTableRow.cs +++ b/dotnet/Cucumber.Messages/generated/PickleTableRow.cs @@ -23,8 +23,8 @@ public PickleTableRow( List cells ) { - RequireNonNull>(cells, "Cells", "PickleTableRow.Cells cannot be null"); - this.Cells = new List(cells); + RequireNonNull>(cells, "Cells", "PickleTableRow.Cells cannot be null"); + this.Cells = new List(cells); } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/PickleTag.cs b/dotnet/Cucumber.Messages/generated/PickleTag.cs index 2f07e815..7e44ae10 100644 --- a/dotnet/Cucumber.Messages/generated/PickleTag.cs +++ b/dotnet/Cucumber.Messages/generated/PickleTag.cs @@ -30,9 +30,9 @@ public PickleTag( string astNodeId ) { - RequireNonNull(name, "Name", "PickleTag.Name cannot be null"); + RequireNonNull(name, "Name", "PickleTag.Name cannot be null"); this.Name = name; - RequireNonNull(astNodeId, "AstNodeId", "PickleTag.AstNodeId cannot be null"); + RequireNonNull(astNodeId, "AstNodeId", "PickleTag.AstNodeId cannot be null"); this.AstNodeId = astNodeId; } diff --git a/dotnet/Cucumber.Messages/generated/Product.cs b/dotnet/Cucumber.Messages/generated/Product.cs index dc398ff7..e157da09 100644 --- a/dotnet/Cucumber.Messages/generated/Product.cs +++ b/dotnet/Cucumber.Messages/generated/Product.cs @@ -33,9 +33,9 @@ public Product( string version ) { - RequireNonNull(name, "Name", "Product.Name cannot be null"); + RequireNonNull(name, "Name", "Product.Name cannot be null"); this.Name = name; - this.Version = version; + this.Version = version; } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/Rule.cs b/dotnet/Cucumber.Messages/generated/Rule.cs index a9843168..180e4f59 100644 --- a/dotnet/Cucumber.Messages/generated/Rule.cs +++ b/dotnet/Cucumber.Messages/generated/Rule.cs @@ -41,19 +41,19 @@ public Rule( string id ) { - RequireNonNull(location, "Location", "Rule.Location cannot be null"); + RequireNonNull(location, "Location", "Rule.Location cannot be null"); this.Location = location; - RequireNonNull>(tags, "Tags", "Rule.Tags cannot be null"); - this.Tags = new List(tags); - RequireNonNull(keyword, "Keyword", "Rule.Keyword cannot be null"); + RequireNonNull>(tags, "Tags", "Rule.Tags cannot be null"); + this.Tags = new List(tags); + RequireNonNull(keyword, "Keyword", "Rule.Keyword cannot be null"); this.Keyword = keyword; - RequireNonNull(name, "Name", "Rule.Name cannot be null"); + RequireNonNull(name, "Name", "Rule.Name cannot be null"); this.Name = name; - RequireNonNull(description, "Description", "Rule.Description cannot be null"); + RequireNonNull(description, "Description", "Rule.Description cannot be null"); this.Description = description; - RequireNonNull>(children, "Children", "Rule.Children cannot be null"); - this.Children = new List(children); - RequireNonNull(id, "Id", "Rule.Id cannot be null"); + RequireNonNull>(children, "Children", "Rule.Children cannot be null"); + this.Children = new List(children); + RequireNonNull(id, "Id", "Rule.Id cannot be null"); this.Id = id; } diff --git a/dotnet/Cucumber.Messages/generated/RuleChild.cs b/dotnet/Cucumber.Messages/generated/RuleChild.cs index daf5465f..bbfae380 100644 --- a/dotnet/Cucumber.Messages/generated/RuleChild.cs +++ b/dotnet/Cucumber.Messages/generated/RuleChild.cs @@ -43,8 +43,8 @@ public RuleChild( Scenario scenario ) { - this.Background = background; - this.Scenario = scenario; + this.Background = background; + this.Scenario = scenario; } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/Scenario.cs b/dotnet/Cucumber.Messages/generated/Scenario.cs index 67c81dcc..741b7a64 100644 --- a/dotnet/Cucumber.Messages/generated/Scenario.cs +++ b/dotnet/Cucumber.Messages/generated/Scenario.cs @@ -40,21 +40,21 @@ public Scenario( string id ) { - RequireNonNull(location, "Location", "Scenario.Location cannot be null"); + RequireNonNull(location, "Location", "Scenario.Location cannot be null"); this.Location = location; - RequireNonNull>(tags, "Tags", "Scenario.Tags cannot be null"); - this.Tags = new List(tags); - RequireNonNull(keyword, "Keyword", "Scenario.Keyword cannot be null"); + RequireNonNull>(tags, "Tags", "Scenario.Tags cannot be null"); + this.Tags = new List(tags); + RequireNonNull(keyword, "Keyword", "Scenario.Keyword cannot be null"); this.Keyword = keyword; - RequireNonNull(name, "Name", "Scenario.Name cannot be null"); + RequireNonNull(name, "Name", "Scenario.Name cannot be null"); this.Name = name; - RequireNonNull(description, "Description", "Scenario.Description cannot be null"); + RequireNonNull(description, "Description", "Scenario.Description cannot be null"); this.Description = description; - RequireNonNull>(steps, "Steps", "Scenario.Steps cannot be null"); - this.Steps = new List(steps); - RequireNonNull>(examples, "Examples", "Scenario.Examples cannot be null"); - this.Examples = new List(examples); - RequireNonNull(id, "Id", "Scenario.Id cannot be null"); + RequireNonNull>(steps, "Steps", "Scenario.Steps cannot be null"); + this.Steps = new List(steps); + RequireNonNull>(examples, "Examples", "Scenario.Examples cannot be null"); + this.Examples = new List(examples); + RequireNonNull(id, "Id", "Scenario.Id cannot be null"); this.Id = id; } diff --git a/dotnet/Cucumber.Messages/generated/Source.cs b/dotnet/Cucumber.Messages/generated/Source.cs index 7f5857bd..b1d69eb6 100644 --- a/dotnet/Cucumber.Messages/generated/Source.cs +++ b/dotnet/Cucumber.Messages/generated/Source.cs @@ -42,11 +42,11 @@ public Source( SourceMediaType mediaType ) { - RequireNonNull(uri, "Uri", "Source.Uri cannot be null"); + RequireNonNull(uri, "Uri", "Source.Uri cannot be null"); this.Uri = uri; - RequireNonNull(data, "Data", "Source.Data cannot be null"); + RequireNonNull(data, "Data", "Source.Data cannot be null"); this.Data = data; - RequireNonNull(mediaType, "MediaType", "Source.MediaType cannot be null"); + RequireNonNull(mediaType, "MediaType", "Source.MediaType cannot be null"); this.MediaType = mediaType; } diff --git a/dotnet/Cucumber.Messages/generated/SourceMediaType.cs b/dotnet/Cucumber.Messages/generated/SourceMediaType.cs index 4bd99e21..3c5a04fd 100644 --- a/dotnet/Cucumber.Messages/generated/SourceMediaType.cs +++ b/dotnet/Cucumber.Messages/generated/SourceMediaType.cs @@ -4,7 +4,12 @@ namespace Io.Cucumber.Messages.Types; -// Generated code +// ------------------------------------------------------------------------------ +// This code was generated based on the Cucumber JSON schema +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// ------------------------------------------------------------------------------ + public enum SourceMediaType { [Description("text/x.cucumber.gherkin+plain")] diff --git a/dotnet/Cucumber.Messages/generated/SourceReference.cs b/dotnet/Cucumber.Messages/generated/SourceReference.cs index 6e3c03b5..3bafab73 100644 --- a/dotnet/Cucumber.Messages/generated/SourceReference.cs +++ b/dotnet/Cucumber.Messages/generated/SourceReference.cs @@ -72,10 +72,10 @@ public SourceReference( Location location ) { - this.Uri = uri; - this.JavaMethod = javaMethod; - this.JavaStackTraceElement = javaStackTraceElement; - this.Location = location; + this.Uri = uri; + this.JavaMethod = javaMethod; + this.JavaStackTraceElement = javaStackTraceElement; + this.Location = location; } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/Step.cs b/dotnet/Cucumber.Messages/generated/Step.cs index cf781728..c49d9c56 100644 --- a/dotnet/Cucumber.Messages/generated/Step.cs +++ b/dotnet/Cucumber.Messages/generated/Step.cs @@ -49,16 +49,16 @@ public Step( string id ) { - RequireNonNull(location, "Location", "Step.Location cannot be null"); + RequireNonNull(location, "Location", "Step.Location cannot be null"); this.Location = location; - RequireNonNull(keyword, "Keyword", "Step.Keyword cannot be null"); + RequireNonNull(keyword, "Keyword", "Step.Keyword cannot be null"); this.Keyword = keyword; - this.KeywordType = keywordType; - RequireNonNull(text, "Text", "Step.Text cannot be null"); + this.KeywordType = keywordType; + RequireNonNull(text, "Text", "Step.Text cannot be null"); this.Text = text; - this.DocString = docString; - this.DataTable = dataTable; - RequireNonNull(id, "Id", "Step.Id cannot be null"); + this.DocString = docString; + this.DataTable = dataTable; + RequireNonNull(id, "Id", "Step.Id cannot be null"); this.Id = id; } diff --git a/dotnet/Cucumber.Messages/generated/StepDefinition.cs b/dotnet/Cucumber.Messages/generated/StepDefinition.cs index 6a898fbd..afb21bfb 100644 --- a/dotnet/Cucumber.Messages/generated/StepDefinition.cs +++ b/dotnet/Cucumber.Messages/generated/StepDefinition.cs @@ -27,11 +27,11 @@ public StepDefinition( SourceReference sourceReference ) { - RequireNonNull(id, "Id", "StepDefinition.Id cannot be null"); + RequireNonNull(id, "Id", "StepDefinition.Id cannot be null"); this.Id = id; - RequireNonNull(pattern, "Pattern", "StepDefinition.Pattern cannot be null"); + RequireNonNull(pattern, "Pattern", "StepDefinition.Pattern cannot be null"); this.Pattern = pattern; - RequireNonNull(sourceReference, "SourceReference", "StepDefinition.SourceReference cannot be null"); + RequireNonNull(sourceReference, "SourceReference", "StepDefinition.SourceReference cannot be null"); this.SourceReference = sourceReference; } diff --git a/dotnet/Cucumber.Messages/generated/StepDefinitionPattern.cs b/dotnet/Cucumber.Messages/generated/StepDefinitionPattern.cs index 6691a521..6d419aac 100644 --- a/dotnet/Cucumber.Messages/generated/StepDefinitionPattern.cs +++ b/dotnet/Cucumber.Messages/generated/StepDefinitionPattern.cs @@ -25,9 +25,9 @@ public StepDefinitionPattern( StepDefinitionPatternType type ) { - RequireNonNull(source, "Source", "StepDefinitionPattern.Source cannot be null"); + RequireNonNull(source, "Source", "StepDefinitionPattern.Source cannot be null"); this.Source = source; - RequireNonNull(type, "Type", "StepDefinitionPattern.Type cannot be null"); + RequireNonNull(type, "Type", "StepDefinitionPattern.Type cannot be null"); this.Type = type; } diff --git a/dotnet/Cucumber.Messages/generated/StepDefinitionPatternType.cs b/dotnet/Cucumber.Messages/generated/StepDefinitionPatternType.cs index 91b8d26a..00a6d9d8 100644 --- a/dotnet/Cucumber.Messages/generated/StepDefinitionPatternType.cs +++ b/dotnet/Cucumber.Messages/generated/StepDefinitionPatternType.cs @@ -4,7 +4,12 @@ namespace Io.Cucumber.Messages.Types; -// Generated code +// ------------------------------------------------------------------------------ +// This code was generated based on the Cucumber JSON schema +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// ------------------------------------------------------------------------------ + public enum StepDefinitionPatternType { [Description("CUCUMBER_EXPRESSION")] diff --git a/dotnet/Cucumber.Messages/generated/StepKeywordType.cs b/dotnet/Cucumber.Messages/generated/StepKeywordType.cs index 436988c3..95c024d9 100644 --- a/dotnet/Cucumber.Messages/generated/StepKeywordType.cs +++ b/dotnet/Cucumber.Messages/generated/StepKeywordType.cs @@ -4,7 +4,12 @@ namespace Io.Cucumber.Messages.Types; -// Generated code +// ------------------------------------------------------------------------------ +// This code was generated based on the Cucumber JSON schema +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// ------------------------------------------------------------------------------ + public enum StepKeywordType { [Description("Unknown")] diff --git a/dotnet/Cucumber.Messages/generated/StepMatchArgument.cs b/dotnet/Cucumber.Messages/generated/StepMatchArgument.cs index 8f26fa8b..00d11e42 100644 --- a/dotnet/Cucumber.Messages/generated/StepMatchArgument.cs +++ b/dotnet/Cucumber.Messages/generated/StepMatchArgument.cs @@ -36,9 +36,9 @@ public StepMatchArgument( string parameterTypeName ) { - RequireNonNull(group, "Group", "StepMatchArgument.Group cannot be null"); + RequireNonNull(group, "Group", "StepMatchArgument.Group cannot be null"); this.Group = group; - this.ParameterTypeName = parameterTypeName; + this.ParameterTypeName = parameterTypeName; } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/StepMatchArgumentsList.cs b/dotnet/Cucumber.Messages/generated/StepMatchArgumentsList.cs index acf9a932..5775236e 100644 --- a/dotnet/Cucumber.Messages/generated/StepMatchArgumentsList.cs +++ b/dotnet/Cucumber.Messages/generated/StepMatchArgumentsList.cs @@ -23,8 +23,8 @@ public StepMatchArgumentsList( List stepMatchArguments ) { - RequireNonNull>(stepMatchArguments, "StepMatchArguments", "StepMatchArgumentsList.StepMatchArguments cannot be null"); - this.StepMatchArguments = new List(stepMatchArguments); + RequireNonNull>(stepMatchArguments, "StepMatchArguments", "StepMatchArgumentsList.StepMatchArguments cannot be null"); + this.StepMatchArguments = new List(stepMatchArguments); } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/TableCell.cs b/dotnet/Cucumber.Messages/generated/TableCell.cs index 42cfe5d2..ee0ae3a3 100644 --- a/dotnet/Cucumber.Messages/generated/TableCell.cs +++ b/dotnet/Cucumber.Messages/generated/TableCell.cs @@ -33,9 +33,9 @@ public TableCell( string value ) { - RequireNonNull(location, "Location", "TableCell.Location cannot be null"); + RequireNonNull(location, "Location", "TableCell.Location cannot be null"); this.Location = location; - RequireNonNull(value, "Value", "TableCell.Value cannot be null"); + RequireNonNull(value, "Value", "TableCell.Value cannot be null"); this.Value = value; } diff --git a/dotnet/Cucumber.Messages/generated/TableRow.cs b/dotnet/Cucumber.Messages/generated/TableRow.cs index 3aa1a717..c3c075bf 100644 --- a/dotnet/Cucumber.Messages/generated/TableRow.cs +++ b/dotnet/Cucumber.Messages/generated/TableRow.cs @@ -35,11 +35,11 @@ public TableRow( string id ) { - RequireNonNull(location, "Location", "TableRow.Location cannot be null"); + RequireNonNull(location, "Location", "TableRow.Location cannot be null"); this.Location = location; - RequireNonNull>(cells, "Cells", "TableRow.Cells cannot be null"); - this.Cells = new List(cells); - RequireNonNull(id, "Id", "TableRow.Id cannot be null"); + RequireNonNull>(cells, "Cells", "TableRow.Cells cannot be null"); + this.Cells = new List(cells); + RequireNonNull(id, "Id", "TableRow.Id cannot be null"); this.Id = id; } diff --git a/dotnet/Cucumber.Messages/generated/Tag.cs b/dotnet/Cucumber.Messages/generated/Tag.cs index 09b1a08e..85976d7d 100644 --- a/dotnet/Cucumber.Messages/generated/Tag.cs +++ b/dotnet/Cucumber.Messages/generated/Tag.cs @@ -38,11 +38,11 @@ public Tag( string id ) { - RequireNonNull(location, "Location", "Tag.Location cannot be null"); + RequireNonNull(location, "Location", "Tag.Location cannot be null"); this.Location = location; - RequireNonNull(name, "Name", "Tag.Name cannot be null"); + RequireNonNull(name, "Name", "Tag.Name cannot be null"); this.Name = name; - RequireNonNull(id, "Id", "Tag.Id cannot be null"); + RequireNonNull(id, "Id", "Tag.Id cannot be null"); this.Id = id; } diff --git a/dotnet/Cucumber.Messages/generated/TestCase.cs b/dotnet/Cucumber.Messages/generated/TestCase.cs index 440457b8..ff83e89a 100644 --- a/dotnet/Cucumber.Messages/generated/TestCase.cs +++ b/dotnet/Cucumber.Messages/generated/TestCase.cs @@ -34,12 +34,12 @@ public TestCase( List testSteps ) { - RequireNonNull(id, "Id", "TestCase.Id cannot be null"); + RequireNonNull(id, "Id", "TestCase.Id cannot be null"); this.Id = id; - RequireNonNull(pickleId, "PickleId", "TestCase.PickleId cannot be null"); + RequireNonNull(pickleId, "PickleId", "TestCase.PickleId cannot be null"); this.PickleId = pickleId; - RequireNonNull>(testSteps, "TestSteps", "TestCase.TestSteps cannot be null"); - this.TestSteps = new List(testSteps); + RequireNonNull>(testSteps, "TestSteps", "TestCase.TestSteps cannot be null"); + this.TestSteps = new List(testSteps); } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/TestCaseFinished.cs b/dotnet/Cucumber.Messages/generated/TestCaseFinished.cs index 3aeab92c..9f98034f 100644 --- a/dotnet/Cucumber.Messages/generated/TestCaseFinished.cs +++ b/dotnet/Cucumber.Messages/generated/TestCaseFinished.cs @@ -27,11 +27,11 @@ public TestCaseFinished( bool willBeRetried ) { - RequireNonNull(testCaseStartedId, "TestCaseStartedId", "TestCaseFinished.TestCaseStartedId cannot be null"); + RequireNonNull(testCaseStartedId, "TestCaseStartedId", "TestCaseFinished.TestCaseStartedId cannot be null"); this.TestCaseStartedId = testCaseStartedId; - RequireNonNull(timestamp, "Timestamp", "TestCaseFinished.Timestamp cannot be null"); + RequireNonNull(timestamp, "Timestamp", "TestCaseFinished.Timestamp cannot be null"); this.Timestamp = timestamp; - RequireNonNull(willBeRetried, "WillBeRetried", "TestCaseFinished.WillBeRetried cannot be null"); + RequireNonNull(willBeRetried, "WillBeRetried", "TestCaseFinished.WillBeRetried cannot be null"); this.WillBeRetried = willBeRetried; } diff --git a/dotnet/Cucumber.Messages/generated/TestCaseStarted.cs b/dotnet/Cucumber.Messages/generated/TestCaseStarted.cs index 5d483616..c5040bd3 100644 --- a/dotnet/Cucumber.Messages/generated/TestCaseStarted.cs +++ b/dotnet/Cucumber.Messages/generated/TestCaseStarted.cs @@ -42,14 +42,14 @@ public TestCaseStarted( Timestamp timestamp ) { - RequireNonNull(attempt, "Attempt", "TestCaseStarted.Attempt cannot be null"); + RequireNonNull(attempt, "Attempt", "TestCaseStarted.Attempt cannot be null"); this.Attempt = attempt; - RequireNonNull(id, "Id", "TestCaseStarted.Id cannot be null"); + RequireNonNull(id, "Id", "TestCaseStarted.Id cannot be null"); this.Id = id; - RequireNonNull(testCaseId, "TestCaseId", "TestCaseStarted.TestCaseId cannot be null"); + RequireNonNull(testCaseId, "TestCaseId", "TestCaseStarted.TestCaseId cannot be null"); this.TestCaseId = testCaseId; - this.WorkerId = workerId; - RequireNonNull(timestamp, "Timestamp", "TestCaseStarted.Timestamp cannot be null"); + this.WorkerId = workerId; + RequireNonNull(timestamp, "Timestamp", "TestCaseStarted.Timestamp cannot be null"); this.Timestamp = timestamp; } diff --git a/dotnet/Cucumber.Messages/generated/TestRunFinished.cs b/dotnet/Cucumber.Messages/generated/TestRunFinished.cs index f5d56804..97c60929 100644 --- a/dotnet/Cucumber.Messages/generated/TestRunFinished.cs +++ b/dotnet/Cucumber.Messages/generated/TestRunFinished.cs @@ -41,12 +41,12 @@ public TestRunFinished( Exception exception ) { - this.Message = message; - RequireNonNull(success, "Success", "TestRunFinished.Success cannot be null"); + this.Message = message; + RequireNonNull(success, "Success", "TestRunFinished.Success cannot be null"); this.Success = success; - RequireNonNull(timestamp, "Timestamp", "TestRunFinished.Timestamp cannot be null"); + RequireNonNull(timestamp, "Timestamp", "TestRunFinished.Timestamp cannot be null"); this.Timestamp = timestamp; - this.Exception = exception; + this.Exception = exception; } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/TestRunStarted.cs b/dotnet/Cucumber.Messages/generated/TestRunStarted.cs index 4cf6ac69..e6ec5c0e 100644 --- a/dotnet/Cucumber.Messages/generated/TestRunStarted.cs +++ b/dotnet/Cucumber.Messages/generated/TestRunStarted.cs @@ -23,7 +23,7 @@ public TestRunStarted( Timestamp timestamp ) { - RequireNonNull(timestamp, "Timestamp", "TestRunStarted.Timestamp cannot be null"); + RequireNonNull(timestamp, "Timestamp", "TestRunStarted.Timestamp cannot be null"); this.Timestamp = timestamp; } diff --git a/dotnet/Cucumber.Messages/generated/TestStep.cs b/dotnet/Cucumber.Messages/generated/TestStep.cs index f59719de..b77abb9c 100644 --- a/dotnet/Cucumber.Messages/generated/TestStep.cs +++ b/dotnet/Cucumber.Messages/generated/TestStep.cs @@ -48,12 +48,12 @@ public TestStep( List stepMatchArgumentsLists ) { - this.HookId = hookId; - RequireNonNull(id, "Id", "TestStep.Id cannot be null"); + this.HookId = hookId; + RequireNonNull(id, "Id", "TestStep.Id cannot be null"); this.Id = id; - this.PickleStepId = pickleStepId; - this.StepDefinitionIds = new List(stepDefinitionIds); - this.StepMatchArgumentsLists = new List(stepMatchArgumentsLists); + this.PickleStepId = pickleStepId; + this.StepDefinitionIds = stepDefinitionIds == null ? null : new List(stepDefinitionIds); + this.StepMatchArgumentsLists = stepMatchArgumentsLists == null ? null : new List(stepMatchArgumentsLists); } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/TestStepFinished.cs b/dotnet/Cucumber.Messages/generated/TestStepFinished.cs index b5e3d6cd..24c0f161 100644 --- a/dotnet/Cucumber.Messages/generated/TestStepFinished.cs +++ b/dotnet/Cucumber.Messages/generated/TestStepFinished.cs @@ -29,13 +29,13 @@ public TestStepFinished( Timestamp timestamp ) { - RequireNonNull(testCaseStartedId, "TestCaseStartedId", "TestStepFinished.TestCaseStartedId cannot be null"); + RequireNonNull(testCaseStartedId, "TestCaseStartedId", "TestStepFinished.TestCaseStartedId cannot be null"); this.TestCaseStartedId = testCaseStartedId; - RequireNonNull(testStepId, "TestStepId", "TestStepFinished.TestStepId cannot be null"); + RequireNonNull(testStepId, "TestStepId", "TestStepFinished.TestStepId cannot be null"); this.TestStepId = testStepId; - RequireNonNull(testStepResult, "TestStepResult", "TestStepFinished.TestStepResult cannot be null"); + RequireNonNull(testStepResult, "TestStepResult", "TestStepFinished.TestStepResult cannot be null"); this.TestStepResult = testStepResult; - RequireNonNull(timestamp, "Timestamp", "TestStepFinished.Timestamp cannot be null"); + RequireNonNull(timestamp, "Timestamp", "TestStepFinished.Timestamp cannot be null"); this.Timestamp = timestamp; } diff --git a/dotnet/Cucumber.Messages/generated/TestStepResult.cs b/dotnet/Cucumber.Messages/generated/TestStepResult.cs index 2a39a789..b2989f0d 100644 --- a/dotnet/Cucumber.Messages/generated/TestStepResult.cs +++ b/dotnet/Cucumber.Messages/generated/TestStepResult.cs @@ -35,12 +35,12 @@ public TestStepResult( Exception exception ) { - RequireNonNull(duration, "Duration", "TestStepResult.Duration cannot be null"); + RequireNonNull(duration, "Duration", "TestStepResult.Duration cannot be null"); this.Duration = duration; - this.Message = message; - RequireNonNull(status, "Status", "TestStepResult.Status cannot be null"); + this.Message = message; + RequireNonNull(status, "Status", "TestStepResult.Status cannot be null"); this.Status = status; - this.Exception = exception; + this.Exception = exception; } public override bool Equals(Object o) diff --git a/dotnet/Cucumber.Messages/generated/TestStepResultStatus.cs b/dotnet/Cucumber.Messages/generated/TestStepResultStatus.cs index b7ed6809..df7eab81 100644 --- a/dotnet/Cucumber.Messages/generated/TestStepResultStatus.cs +++ b/dotnet/Cucumber.Messages/generated/TestStepResultStatus.cs @@ -4,7 +4,12 @@ namespace Io.Cucumber.Messages.Types; -// Generated code +// ------------------------------------------------------------------------------ +// This code was generated based on the Cucumber JSON schema +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// ------------------------------------------------------------------------------ + public enum TestStepResultStatus { [Description("UNKNOWN")] diff --git a/dotnet/Cucumber.Messages/generated/TestStepStarted.cs b/dotnet/Cucumber.Messages/generated/TestStepStarted.cs index e7b33f50..365030dc 100644 --- a/dotnet/Cucumber.Messages/generated/TestStepStarted.cs +++ b/dotnet/Cucumber.Messages/generated/TestStepStarted.cs @@ -27,11 +27,11 @@ public TestStepStarted( Timestamp timestamp ) { - RequireNonNull(testCaseStartedId, "TestCaseStartedId", "TestStepStarted.TestCaseStartedId cannot be null"); + RequireNonNull(testCaseStartedId, "TestCaseStartedId", "TestStepStarted.TestCaseStartedId cannot be null"); this.TestCaseStartedId = testCaseStartedId; - RequireNonNull(testStepId, "TestStepId", "TestStepStarted.TestStepId cannot be null"); + RequireNonNull(testStepId, "TestStepId", "TestStepStarted.TestStepId cannot be null"); this.TestStepId = testStepId; - RequireNonNull(timestamp, "Timestamp", "TestStepStarted.Timestamp cannot be null"); + RequireNonNull(timestamp, "Timestamp", "TestStepStarted.Timestamp cannot be null"); this.Timestamp = timestamp; } diff --git a/dotnet/Cucumber.Messages/generated/Timestamp.cs b/dotnet/Cucumber.Messages/generated/Timestamp.cs index 03860520..b0f3d523 100644 --- a/dotnet/Cucumber.Messages/generated/Timestamp.cs +++ b/dotnet/Cucumber.Messages/generated/Timestamp.cs @@ -36,9 +36,9 @@ public Timestamp( long nanos ) { - RequireNonNull(seconds, "Seconds", "Timestamp.Seconds cannot be null"); + RequireNonNull(seconds, "Seconds", "Timestamp.Seconds cannot be null"); this.Seconds = seconds; - RequireNonNull(nanos, "Nanos", "Timestamp.Nanos cannot be null"); + RequireNonNull(nanos, "Nanos", "Timestamp.Nanos cannot be null"); this.Nanos = nanos; } diff --git a/dotnet/Cucumber.Messages/generated/UndefinedParameterType.cs b/dotnet/Cucumber.Messages/generated/UndefinedParameterType.cs index c20f43d4..f139fc68 100644 --- a/dotnet/Cucumber.Messages/generated/UndefinedParameterType.cs +++ b/dotnet/Cucumber.Messages/generated/UndefinedParameterType.cs @@ -25,9 +25,9 @@ public UndefinedParameterType( string name ) { - RequireNonNull(expression, "Expression", "UndefinedParameterType.Expression cannot be null"); + RequireNonNull(expression, "Expression", "UndefinedParameterType.Expression cannot be null"); this.Expression = expression; - RequireNonNull(name, "Name", "UndefinedParameterType.Name cannot be null"); + RequireNonNull(name, "Name", "UndefinedParameterType.Name cannot be null"); this.Name = name; }