ptupitsyn commented on a change in pull request #8568: URL: https://github.com/apache/ignite/pull/8568#discussion_r547424529
########## File path: modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryDateTimeTest.cs ########## @@ -110,6 +111,34 @@ public void TestClassAttributes() AssertTimestampField<DateTimeClassAttribute2>((o, d) => o.Value = d, o => o.Value, "Value"); } +#if NETCOREAPP + /// <summary> + /// Tests custom timestamp converter. + /// </summary> + [Test] + public void TestCustomTimestampConverter() + { + var cfg = new IgniteConfiguration(TestUtils.GetTestConfiguration(name: "ignite-1")) + { + BinaryConfiguration = new BinaryConfiguration() + { + ForceTimestamp = true, + TimestampConverter = new TimestampConverter() + } + }; + var ignite = Ignition.Start(cfg); + var binary = ignite.GetBinary(); + + // Check config. + Assert.NotNull(ignite.GetConfiguration().BinaryConfiguration.TimestampConverter); + + AssertTimestampField<DateTimeObj2>((o, d) => o.Value = d, o => o.Value, "Value"); + + var ex = Assert.Throws<BinaryObjectException>(() => binary.ToBinary<IBinaryObject>(new DateTime(1997, 8, 29)), + "Converter Error!"); Review comment: 1. Unused variable `ex`. 2. `"Converter Error!"` is a message that will be displayed on assertion failure. I think the intent here is to check the exception message instead. To do that, add `Assert.AreEqual("Converter Error!", ex.Message)`. ########## File path: modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryDateTimeTest.cs ########## @@ -110,6 +111,34 @@ public void TestClassAttributes() AssertTimestampField<DateTimeClassAttribute2>((o, d) => o.Value = d, o => o.Value, "Value"); } +#if NETCOREAPP Review comment: I think this test will work on .NET Framework too (and we should have a test that works on .NET Framework). ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org