From 4e6fba64dea8cb1cc59c1e8897b4acfbab2cc40f Mon Sep 17 00:00:00 2001 From: Ian Griffiths Date: Tue, 2 Mar 2021 15:09:00 +0000 Subject: [PATCH] Handle fragmented messages with no sentence group header --- ...ongRangeAisBroadcastParserSpecs.feature.cs | 6 +- ...PositionReportClassAParserSpecs.feature.cs | 6 +- ...PositionReportClassBParserSpecs.feature.cs | 6 +- ...ReportExtendedClassBParserSpecs.feature.cs | 6 +- ...AndVoyageRelatedDataParserSpecs.feature.cs | 6 +- .../StaticDataReportParserSpecs.feature.cs | 6 +- .../Ais/Net/Specs/AisStringsSpecs.feature.cs | 6 +- .../Ais/Net/Specs/AivdmExamples.cs | 1 + .../NmeaAisBitVectorParserSpecs.feature.cs | 6 +- .../NmeaLineToAisStreamAdapterSpecs.feature | 88 +++ ...NmeaLineToAisStreamAdapterSpecs.feature.cs | 679 +++++++++++++----- .../NmeaStreamParserByLineSpecs.feature.cs | 6 +- .../NmeaStreamParserByMessageSpecs.feature.cs | 6 +- .../Net/Specs/ParsePayloadSpecs.feature.cs | 6 +- .../Ais/Net/Specs/SentenceLayerSpecs.feature | 18 + .../Net/Specs/SentenceLayerSpecs.feature.cs | 76 +- .../Ais/Net/Specs/SentenceLayerSpecsSteps.cs | 7 + .../Ais/Net/NmeaLineToAisStreamAdapter.cs | 53 +- 18 files changed, 772 insertions(+), 216 deletions(-) diff --git a/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/LongRangeAisBroadcastParserSpecs.feature.cs b/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/LongRangeAisBroadcastParserSpecs.feature.cs index 91e4f82..83b2f42 100644 --- a/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/LongRangeAisBroadcastParserSpecs.feature.cs +++ b/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/LongRangeAisBroadcastParserSpecs.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.6.0.0 -// SpecFlow Generator Version:3.6.0.0 +// SpecFlow Version:3.7.0.0 +// SpecFlow Generator Version:3.7.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace Ais.Net.Specs.AisMessageTypes using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.6.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("LongRangeAisBroadcastParserSpecs")] diff --git a/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/PositionReportClassAParserSpecs.feature.cs b/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/PositionReportClassAParserSpecs.feature.cs index 6fa93d1..01bdae8 100644 --- a/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/PositionReportClassAParserSpecs.feature.cs +++ b/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/PositionReportClassAParserSpecs.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.6.0.0 -// SpecFlow Generator Version:3.6.0.0 +// SpecFlow Version:3.7.0.0 +// SpecFlow Generator Version:3.7.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace Ais.Net.Specs.AisMessageTypes using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.6.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("PositionReportClassAParserSpecs")] diff --git a/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/PositionReportClassBParserSpecs.feature.cs b/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/PositionReportClassBParserSpecs.feature.cs index 3399108..1a3bcda 100644 --- a/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/PositionReportClassBParserSpecs.feature.cs +++ b/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/PositionReportClassBParserSpecs.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.6.0.0 -// SpecFlow Generator Version:3.6.0.0 +// SpecFlow Version:3.7.0.0 +// SpecFlow Generator Version:3.7.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace Ais.Net.Specs.AisMessageTypes using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.6.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("PositionReportClassBParserSpecs")] diff --git a/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/PositionReportExtendedClassBParserSpecs.feature.cs b/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/PositionReportExtendedClassBParserSpecs.feature.cs index f56adc7..f6f9609 100644 --- a/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/PositionReportExtendedClassBParserSpecs.feature.cs +++ b/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/PositionReportExtendedClassBParserSpecs.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.6.0.0 -// SpecFlow Generator Version:3.6.0.0 +// SpecFlow Version:3.7.0.0 +// SpecFlow Generator Version:3.7.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace Ais.Net.Specs.AisMessageTypes using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.6.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("PositionReportExtendedClassBParserSpecs")] diff --git a/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/StaticAndVoyageRelatedDataParserSpecs.feature.cs b/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/StaticAndVoyageRelatedDataParserSpecs.feature.cs index f45baca..ff64584 100644 --- a/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/StaticAndVoyageRelatedDataParserSpecs.feature.cs +++ b/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/StaticAndVoyageRelatedDataParserSpecs.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.6.0.0 -// SpecFlow Generator Version:3.6.0.0 +// SpecFlow Version:3.7.0.0 +// SpecFlow Generator Version:3.7.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace Ais.Net.Specs.AisMessageTypes using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.6.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("StaticAndVoyageRelatedDataParserSpecs")] diff --git a/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/StaticDataReportParserSpecs.feature.cs b/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/StaticDataReportParserSpecs.feature.cs index e9735a2..4eae357 100644 --- a/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/StaticDataReportParserSpecs.feature.cs +++ b/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisMessageTypes/StaticDataReportParserSpecs.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.6.0.0 -// SpecFlow Generator Version:3.6.0.0 +// SpecFlow Version:3.7.0.0 +// SpecFlow Generator Version:3.7.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace Ais.Net.Specs.AisMessageTypes using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.6.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("StaticDataReportParserSpecs")] diff --git a/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisStringsSpecs.feature.cs b/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisStringsSpecs.feature.cs index ae82988..2fb76ab 100644 --- a/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisStringsSpecs.feature.cs +++ b/Solutions/Ais.Net.Specs/Ais/Net/Specs/AisStringsSpecs.feature.cs @@ -1,8 +1,8 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.6.0.0 -// SpecFlow Generator Version:3.6.0.0 +// SpecFlow Version:3.7.0.0 +// SpecFlow Generator Version:3.7.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace Ais.Net.Specs using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.6.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("AisStringsSpecs")] diff --git a/Solutions/Ais.Net.Specs/Ais/Net/Specs/AivdmExamples.cs b/Solutions/Ais.Net.Specs/Ais/Net/Specs/AivdmExamples.cs index c98dcc5..94f8bb9 100644 --- a/Solutions/Ais.Net.Specs/Ais/Net/Specs/AivdmExamples.cs +++ b/Solutions/Ais.Net.Specs/Ais/Net/Specs/AivdmExamples.cs @@ -18,6 +18,7 @@ internal static class AivdmExamples public const string SomeSortOfAivdmMessageRenameThisWhenWeKnowMoreWithTagBlock = @"\" + SimpleTagBlockWithoutDelimiters + @"\" + SomeSortOfAivdmMessageRenameThisWhenWeKnowMore; public const string MessageWithTaAGPLaceholderFormat = @"\s:42,c:1567684904*38\!{0},1,1,,A,B3m:H900AP@b:79ae6: // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.6.0.0 -// SpecFlow Generator Version:3.6.0.0 +// SpecFlow Version:3.7.0.0 +// SpecFlow Generator Version:3.7.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace Ais.Net.Specs using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.6.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("NmeaAisBitVectorParserSpecs")] diff --git a/Solutions/Ais.Net.Specs/Ais/Net/Specs/NmeaLineToAisStreamAdapterSpecs.feature b/Solutions/Ais.Net.Specs/Ais/Net/Specs/NmeaLineToAisStreamAdapterSpecs.feature index e896e82..3dc0986 100644 --- a/Solutions/Ais.Net.Specs/Ais/Net/Specs/NmeaLineToAisStreamAdapterSpecs.feature +++ b/Solutions/Ais.Net.Specs/Ais/Net/Specs/NmeaLineToAisStreamAdapterSpecs.feature @@ -25,6 +25,11 @@ Scenario: First fragment of two-part message received When the line to message adapter receives '\g:1-2-8055,s:99,c:1567685556*4E\!AIVDM,2,1,6,B,53oGfN42=WRDhlHn221<4i@Dr22222222222220`1@O6640Ht50Skp4mR`4l,0*72' Then INmeaAisMessageStreamProcessor.OnNext should have been called 0 times +Scenario: First fragment of two-part message without grouping in header received + # ais.kystverket.no + When the line to message adapter receives '\s:99,c:1567685556*4E\!AIVDM,2,1,6,B,53oGfN42=WRDhlHn221<4i@Dr22222222222220`1@O6640Ht50Skp4mR`4l,0*72' + Then INmeaAisMessageStreamProcessor.OnNext should have been called 0 times + Scenario: Two-fragment message fragments received adjacently # ais.kystverket.no When the line to message adapter receives '\g:1-2-8055,s:99,c:1567685556*4E\!AIVDM,2,1,6,B,53oGfN42=WRDhlHn221<4i@Dr22222222222220`1@O6640Ht50Skp4mR`4l,0*72' @@ -36,6 +41,17 @@ Scenario: Two-fragment message fragments received adjacently And in ais message 0 the source from the first NMEA line should be 99 And in ais message 0 the timestamp from the first NMEA line should be 1567685556 +Scenario: Two-fragment message fragments without grouping in header received adjacently + # ais.kystverket.no + When the line to message adapter receives '\s:99,c:1567685556*4E\!AIVDM,2,1,6,B,53oGfN42=WRDhlHn221<4i@Dr22222222222220`1@O6640Ht50Skp4mR`4l,0*72' + # ais.kystverket.no + And the line to message adapter receives '\s:99*55\!AIVDM,2,2,6,B,j`888888880,2*2B' + Then INmeaAisMessageStreamProcessor.OnNext should have been called 1 time + # ais.kystverket.no + And in ais message 0 the payload should be '53oGfN42=WRDhlHn221<4i@Dr22222222222220`1@O6640Ht50Skp4mR`4lj`888888880' with padding of 2 + And in ais message 0 the source from the first NMEA line should be 99 + And in ais message 0 the timestamp from the first NMEA line should be 1567685556 + Scenario: Two-fragment message fragments received with single-fragment message in the middle # ais.kystverket.no When the line to message adapter receives '\g:1-2-8055,s:99,c:1567685556*4E\!AIVDM,2,1,6,B,53oGfN42=WRDhlHn221<4i@Dr22222222222220`1@O6640Ht50Skp4mR`4l,0*72' @@ -53,6 +69,23 @@ Scenario: Two-fragment message fragments received with single-fragment message i And in ais message 1 the source from the first NMEA line should be 99 And in ais message 1 the timestamp from the first NMEA line should be 1567685556 +Scenario: Two-fragment message fragments without grouping in header received with single-fragment message in the middle + # ais.kystverket.no + When the line to message adapter receives '\s:99,c:1567685556*4E\!AIVDM,2,1,6,B,53oGfN42=WRDhlHn221<4i@Dr22222222222220`1@O6640Ht50Skp4mR`4l,0*72' + # ais.kystverket.no + And the line to message adapter receives '\s:42,c:1567684904*38\!AIVDM,1,1,,B,33m9UtPP@50wwE:VJW6LS67H01<@,0*3C' + # ais.kystverket.no + And the line to message adapter receives '\s:99*55\!AIVDM,2,2,6,B,j`888888880,2*2B' + Then INmeaAisMessageStreamProcessor.OnNext should have been called 2 times + # ais.kystverket.no + And in ais message 0 the payload should be '33m9UtPP@50wwE:VJW6LS67H01<@' with padding of 0 + And in ais message 0 the source from the first NMEA line should be 42 + And in ais message 0 the timestamp from the first NMEA line should be 1567684904 + # ais.kystverket.no + And in ais message 1 the payload should be '53oGfN42=WRDhlHn221<4i@Dr22222222222220`1@O6640Ht50Skp4mR`4lj`888888880' with padding of 2 + And in ais message 1 the source from the first NMEA line should be 99 + And in ais message 1 the timestamp from the first NMEA line should be 1567685556 + Scenario: Three-fragment message fragments received adjacently # ais.kystverket.no When the line to message adapter receives '\g:1-3-3451,s:27,c:1567686150*40\!AIVDM,3,1,9,A,544MR0827oeaD // This code was generated by SpecFlow (https://www.specflow.org/). -// SpecFlow Version:3.6.0.0 -// SpecFlow Generator Version:3.6.0.0 +// SpecFlow Version:3.7.0.0 +// SpecFlow Generator Version:3.7.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace Ais.Net.Specs using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.6.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.7.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("NmeaLineToAisStreamAdapterSpecs")] @@ -161,6 +161,44 @@ public virtual void FirstFragmentOfTwo_PartMessageReceived() this.ScenarioCleanup(); } + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("First fragment of two-part message without grouping in header received")] + public virtual void FirstFragmentOfTwo_PartMessageWithoutGroupingInHeaderReceived() + { + string[] tagsOfScenario = ((string[])(null)); + System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("First fragment of two-part message without grouping in header received", null, tagsOfScenario, argumentsOfScenario, this._featureTags); +#line 28 +this.ScenarioInitialize(scenarioInfo); +#line hidden + bool isScenarioIgnored = default(bool); + bool isFeatureIgnored = default(bool); + if ((tagsOfScenario != null)) + { + isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); + } + if ((this._featureTags != null)) + { + isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); + } + if ((isScenarioIgnored || isFeatureIgnored)) + { + testRunner.SkipScenario(); + } + else + { + this.ScenarioStart(); +#line 30 + testRunner.When("the line to message adapter receives \'\\s:99,c:1567685556*4E\\!AIVDM,2,1,6,B,53oGfN" + + "42=WRDhlHn221<4i@Dr22222222222220`1@O6640Ht50Skp4mR`4l,0*72\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden +#line 31 + testRunner.Then("INmeaAisMessageStreamProcessor.OnNext should have been called 0 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + } + this.ScenarioCleanup(); + } + [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Two-fragment message fragments received adjacently")] public virtual void Two_FragmentMessageFragmentsReceivedAdjacently() @@ -168,7 +206,7 @@ public virtual void Two_FragmentMessageFragmentsReceivedAdjacently() string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Two-fragment message fragments received adjacently", null, tagsOfScenario, argumentsOfScenario, this._featureTags); -#line 28 +#line 33 this.ScenarioInitialize(scenarioInfo); #line hidden bool isScenarioIgnored = default(bool); @@ -188,25 +226,76 @@ public virtual void Two_FragmentMessageFragmentsReceivedAdjacently() else { this.ScenarioStart(); -#line 30 +#line 35 testRunner.When("the line to message adapter receives \'\\g:1-2-8055,s:99,c:1567685556*4E\\!AIVDM,2,1" + ",6,B,53oGfN42=WRDhlHn221<4i@Dr22222222222220`1@O6640Ht50Skp4mR`4l,0*72\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden -#line 32 +#line 37 testRunner.And("the line to message adapter receives \'\\g:2-2-8055*55\\!AIVDM,2,2,6,B,j`888888880,2" + "*2B\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 33 +#line 38 testRunner.Then("INmeaAisMessageStreamProcessor.OnNext should have been called 1 time", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); #line hidden -#line 35 +#line 40 testRunner.And("in ais message 0 the payload should be \'53oGfN42=WRDhlHn221<4i@Dr22222222222220`1" + "@O6640Ht50Skp4mR`4lj`888888880\' with padding of 2", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 36 +#line 41 testRunner.And("in ais message 0 the source from the first NMEA line should be 99", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 37 +#line 42 + testRunner.And("in ais message 0 the timestamp from the first NMEA line should be 1567685556", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + } + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Two-fragment message fragments without grouping in header received adjacently")] + public virtual void Two_FragmentMessageFragmentsWithoutGroupingInHeaderReceivedAdjacently() + { + string[] tagsOfScenario = ((string[])(null)); + System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Two-fragment message fragments without grouping in header received adjacently", null, tagsOfScenario, argumentsOfScenario, this._featureTags); +#line 44 +this.ScenarioInitialize(scenarioInfo); +#line hidden + bool isScenarioIgnored = default(bool); + bool isFeatureIgnored = default(bool); + if ((tagsOfScenario != null)) + { + isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); + } + if ((this._featureTags != null)) + { + isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); + } + if ((isScenarioIgnored || isFeatureIgnored)) + { + testRunner.SkipScenario(); + } + else + { + this.ScenarioStart(); +#line 46 + testRunner.When("the line to message adapter receives \'\\s:99,c:1567685556*4E\\!AIVDM,2,1,6,B,53oGfN" + + "42=WRDhlHn221<4i@Dr22222222222220`1@O6640Ht50Skp4mR`4l,0*72\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden +#line 48 + testRunner.And("the line to message adapter receives \'\\s:99*55\\!AIVDM,2,2,6,B,j`888888880,2*2B\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 49 + testRunner.Then("INmeaAisMessageStreamProcessor.OnNext should have been called 1 time", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden +#line 51 + testRunner.And("in ais message 0 the payload should be \'53oGfN42=WRDhlHn221<4i@Dr22222222222220`1" + + "@O6640Ht50Skp4mR`4lj`888888880\' with padding of 2", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 52 + testRunner.And("in ais message 0 the source from the first NMEA line should be 99", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 53 testRunner.And("in ais message 0 the timestamp from the first NMEA line should be 1567685556", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden } @@ -222,7 +311,7 @@ public virtual void Two_FragmentMessageFragmentsReceivedWithSingle_FragmentMessa System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Two-fragment message fragments received with single-fragment message in the middl" + "e", null, tagsOfScenario, argumentsOfScenario, this._featureTags); -#line 39 +#line 55 this.ScenarioInitialize(scenarioInfo); #line hidden bool isScenarioIgnored = default(bool); @@ -242,39 +331,106 @@ public virtual void Two_FragmentMessageFragmentsReceivedWithSingle_FragmentMessa else { this.ScenarioStart(); -#line 41 +#line 57 testRunner.When("the line to message adapter receives \'\\g:1-2-8055,s:99,c:1567685556*4E\\!AIVDM,2,1" + ",6,B,53oGfN42=WRDhlHn221<4i@Dr22222222222220`1@O6640Ht50Skp4mR`4l,0*72\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden -#line 43 +#line 59 testRunner.And("the line to message adapter receives \'\\s:42,c:1567684904*38\\!AIVDM,1,1,,B,33m9UtP" + "P@50wwE:VJW6LS67H01<@,0*3C\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 45 +#line 61 testRunner.And("the line to message adapter receives \'\\g:2-2-8055*55\\!AIVDM,2,2,6,B,j`888888880,2" + "*2B\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 46 +#line 62 testRunner.Then("INmeaAisMessageStreamProcessor.OnNext should have been called 2 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); #line hidden -#line 48 +#line 64 testRunner.And("in ais message 0 the payload should be \'33m9UtPP@50wwE:VJW6LS67H01<@\' with paddin" + "g of 0", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 49 +#line 65 testRunner.And("in ais message 0 the source from the first NMEA line should be 42", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 50 +#line 66 testRunner.And("in ais message 0 the timestamp from the first NMEA line should be 1567684904", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 52 +#line 68 testRunner.And("in ais message 1 the payload should be \'53oGfN42=WRDhlHn221<4i@Dr22222222222220`1" + "@O6640Ht50Skp4mR`4lj`888888880\' with padding of 2", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 53 +#line 69 + testRunner.And("in ais message 1 the source from the first NMEA line should be 99", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 70 + testRunner.And("in ais message 1 the timestamp from the first NMEA line should be 1567685556", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + } + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Two-fragment message fragments without grouping in header received with single-fr" + + "agment message in the middle")] + public virtual void Two_FragmentMessageFragmentsWithoutGroupingInHeaderReceivedWithSingle_FragmentMessageInTheMiddle() + { + string[] tagsOfScenario = ((string[])(null)); + System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Two-fragment message fragments without grouping in header received with single-fr" + + "agment message in the middle", null, tagsOfScenario, argumentsOfScenario, this._featureTags); +#line 72 +this.ScenarioInitialize(scenarioInfo); +#line hidden + bool isScenarioIgnored = default(bool); + bool isFeatureIgnored = default(bool); + if ((tagsOfScenario != null)) + { + isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); + } + if ((this._featureTags != null)) + { + isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); + } + if ((isScenarioIgnored || isFeatureIgnored)) + { + testRunner.SkipScenario(); + } + else + { + this.ScenarioStart(); +#line 74 + testRunner.When("the line to message adapter receives \'\\s:99,c:1567685556*4E\\!AIVDM,2,1,6,B,53oGfN" + + "42=WRDhlHn221<4i@Dr22222222222220`1@O6640Ht50Skp4mR`4l,0*72\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden +#line 76 + testRunner.And("the line to message adapter receives \'\\s:42,c:1567684904*38\\!AIVDM,1,1,,B,33m9UtP" + + "P@50wwE:VJW6LS67H01<@,0*3C\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 78 + testRunner.And("the line to message adapter receives \'\\s:99*55\\!AIVDM,2,2,6,B,j`888888880,2*2B\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 79 + testRunner.Then("INmeaAisMessageStreamProcessor.OnNext should have been called 2 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden +#line 81 + testRunner.And("in ais message 0 the payload should be \'33m9UtPP@50wwE:VJW6LS67H01<@\' with paddin" + + "g of 0", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 82 + testRunner.And("in ais message 0 the source from the first NMEA line should be 42", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 83 + testRunner.And("in ais message 0 the timestamp from the first NMEA line should be 1567684904", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 85 + testRunner.And("in ais message 1 the payload should be \'53oGfN42=WRDhlHn221<4i@Dr22222222222220`1" + + "@O6640Ht50Skp4mR`4lj`888888880\' with padding of 2", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 86 testRunner.And("in ais message 1 the source from the first NMEA line should be 99", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 54 +#line 87 testRunner.And("in ais message 1 the timestamp from the first NMEA line should be 1567685556", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden } @@ -288,7 +444,7 @@ public virtual void Three_FragmentMessageFragmentsReceivedAdjacently() string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Three-fragment message fragments received adjacently", null, tagsOfScenario, argumentsOfScenario, this._featureTags); -#line 56 +#line 89 this.ScenarioInitialize(scenarioInfo); #line hidden bool isScenarioIgnored = default(bool); @@ -308,29 +464,84 @@ public virtual void Three_FragmentMessageFragmentsReceivedAdjacently() else { this.ScenarioStart(); -#line 58 +#line 91 testRunner.When("the line to message adapter receives \'\\g:1-3-3451,s:27,c:1567686150*40\\!AIVDM,3,1" + ",9,A,544MR0827oeaD