ShaiviAgarwal2 commented on issue #37577:
URL: https://github.com/apache/arrow/issues/37577#issuecomment-1872836543

   @kevingurney 
   To reduce code duplication in the tests for `Date32Type` and `Date64Type` 
can be done by creating a shared superclass for `DateType`-related tests. This 
superclass would contain common test methods and properties that are shared 
between `Date32Type` and `Date64Type`.
   
   We can do the same by following the mentioned steps:-
   
   Firstly, we will define a new class `DateTypeTest` that will serve as the 
superclass.
   Then we will identify the common test methods and properties between 
`Date32Type` and `Date64Type`.
   Then move these common methods and properties to the `DateTypeTest` 
superclass.
   Finally, we will make the test classes for `Date32Type` and `Date64Type` 
inherit from the `DateTypeTest` superclass.
   
   I have created it with a basic example of how this might look in MATLAB but 
the actual implementation will depend upon the properties and methods common to 
`Date32Type` and `Date64Type`
   
   ```
   classdef DateTypeTest < matlab.unittest.TestCase
       % Common properties and methods for Date32Type and Date64Type tests
   
       properties
           % Common properties
       end
   
       methods(Test)
           % Common test methods
       end
   end
   
   classdef Date32TypeTest < DateTypeTest
       % Specific properties and methods for Date32Type tests
   end
   
   classdef Date64TypeTest < DateTypeTest
       % Specific properties and methods for Date64Type tests
   end
   ```


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to