class TestCase::Module::Double {
  use Fn;
  
  static method basic : int () {
    # Initialization and value check
    {
      my $numeric_object = Double->new(Fn->DBL_MIN());
      unless ($numeric_object->value == Fn->DBL_MIN()) { return 0; }
    }
    
    # Mutable test
    {
      my $numeric_object = Double->new(1.0);
      $numeric_object->set_value(10.0);
      unless ($numeric_object->value == 10.0) { return 0; }
    }

    # Clone test
    {
      my $numeric_object = Double->new(5.0);
      my $cloned_object = $numeric_object->clone;
      unless ($cloned_object->value == 5.0) { return 0; }
      $cloned_object->set_value(20.0);
      if ($numeric_object->value == 20.0) { return 0; }
    }

    # Read-only test
    {
      my $numeric_object = Double->new(1.0);
      $numeric_object->make_read_only;
      eval { $numeric_object->set_value(10.0); };
      unless (Fn->contains($@, "The object is read-only and its value cannot be changed.")) {
        return 0;
      }
    }
    
    return 1;
  }
}
