@@ -3932,6 +3932,31 @@ public void TestOptionalConstructorString_Success()
39323932 }
39333933 }
39343934
3935+ // Issue233
3936+ [Test]
3937+ public void TestConstructorDeserializationWithParametersNotInLexicalOrder()
3938+ {
3939+ var endpoints =
3940+ new EndpointList(
3941+ "Test String One",
3942+ new Dictionary<string, string[]>
3943+ {
3944+ { "ConfigService", new [] { "ur1", "ur2" } },
3945+ { "TestService", new [] { "ur1", "ur2" } }
3946+ },
3947+ "Test String Two"
3948+ );
3949+
3950+ var context = new SerializationContext();
3951+ var ser = context.GetSerializer<EndpointList>();
3952+ var bytes = ser.PackSingleObject( endpoints );
3953+ var endpointsDeser = ser.UnpackSingleObject( bytes );
3954+
3955+ Assert.That( endpointsDeser.StringOne, Is.EqualTo( endpoints.StringOne ) );
3956+ Assert.That( endpointsDeser.StringTwo, Is.EqualTo( endpoints.StringTwo ) );
3957+ Assert.That( endpointsDeser.Endpoints, Is.EqualTo( endpoints.Endpoints ) );
3958+ }
3959+
39353960 [Test]
39363961 public void TestCollection_Success()
39373962 {
@@ -21081,25 +21106,73 @@ public void TestUriFieldArrayNull()
2108121106 }
2108221107
2108321108 [Test]
21084- public void TestVersionField()
21109+ public void TestVersionConstructorMajorMinor()
21110+ {
21111+ this.TestCoreWithAutoVerify( new Version( 1, 2 ), GetSerializationContext() );
21112+ }
21113+
21114+ [Test]
21115+ public void TestVersionConstructorMajorMinorArray()
21116+ {
21117+ this.TestCoreWithAutoVerify( Enumerable.Repeat( new Version( 1, 2 ), 2 ).ToArray(), GetSerializationContext() );
21118+ }
21119+
21120+ [Test]
21121+ public void TestVersionConstructorMajorMinorNull()
21122+ {
21123+ this.TestCoreWithAutoVerify( default( Version ), GetSerializationContext() );
21124+ }
21125+
21126+ [Test]
21127+ public void TestVersionConstructorMajorMinorArrayNull()
21128+ {
21129+ this.TestCoreWithAutoVerify( default( Version[] ), GetSerializationContext() );
21130+ }
21131+
21132+ [Test]
21133+ public void TestVersionConstructorMajorMinorBuild()
21134+ {
21135+ this.TestCoreWithAutoVerify( new Version( 1, 2, 3 ), GetSerializationContext() );
21136+ }
21137+
21138+ [Test]
21139+ public void TestVersionConstructorMajorMinorBuildArray()
21140+ {
21141+ this.TestCoreWithAutoVerify( Enumerable.Repeat( new Version( 1, 2, 3 ), 2 ).ToArray(), GetSerializationContext() );
21142+ }
21143+
21144+ [Test]
21145+ public void TestVersionConstructorMajorMinorBuildNull()
21146+ {
21147+ this.TestCoreWithAutoVerify( default( Version ), GetSerializationContext() );
21148+ }
21149+
21150+ [Test]
21151+ public void TestVersionConstructorMajorMinorBuildArrayNull()
21152+ {
21153+ this.TestCoreWithAutoVerify( default( Version[] ), GetSerializationContext() );
21154+ }
21155+
21156+ [Test]
21157+ public void TestFullVersionConstructor()
2108521158 {
2108621159 this.TestCoreWithAutoVerify( new Version( 1, 2, 3, 4 ), GetSerializationContext() );
2108721160 }
2108821161
2108921162 [Test]
21090- public void TestVersionFieldArray ()
21163+ public void TestFullVersionConstructorArray ()
2109121164 {
2109221165 this.TestCoreWithAutoVerify( Enumerable.Repeat( new Version( 1, 2, 3, 4 ), 2 ).ToArray(), GetSerializationContext() );
2109321166 }
2109421167
2109521168 [Test]
21096- public void TestVersionFieldNull ()
21169+ public void TestFullVersionConstructorNull ()
2109721170 {
2109821171 this.TestCoreWithAutoVerify( default( Version ), GetSerializationContext() );
2109921172 }
2110021173
2110121174 [Test]
21102- public void TestVersionFieldArrayNull ()
21175+ public void TestFullVersionConstructorArrayNull ()
2110321176 {
2110421177 this.TestCoreWithAutoVerify( default( Version[] ), GetSerializationContext() );
2110521178 }
0 commit comments