public void TestClassWithNullableTimeSpan() { var value = new ClassWithNullableTimeSpan { Value = TimeSpan.FromSeconds(1.5) }; _serializer.ShouldRoundtrip(value); }
public static void WriteValueNotNull(BinaryWriter writer, ClassWithNullableTimeSpan obj, ISerializer serializer) { var tmp = obj.Value.HasValue; writer.Write(tmp); if (tmp) { writer.Write(obj.Value.Value.Ticks); } }