Changeset 239

Show
Ignore:
Timestamp:
08/31/08 22:27:39 (4 months ago)
Author:
pwh
Message:
  • ipvpn_test.rb: Added unit tests.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nethorus/test/unit/ipvpn_test.rb

    r13 r239  
     1# 
     2#  NetHorus: An Open Source Network Management System 
     3#  Copyright (C)2000-2008 Peter Hicks 
     4# 
     5#  This program is free software; you can redistribute it and/or modify it 
     6#  under the terms of the GNU General Public License as published by the 
     7#  Free Software Foundation; either version 2 of the License, or (at your 
     8#  option) any later version. 
     9# 
     10#  This program is distributed in the hope that it will be useful, but 
     11#  WITHOUT ANY WARRANTY; without even the implied warranty of 
     12#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General 
     13#  Public License for more details. 
     14# 
     15#  You should have received a copy of the GNU General Public License along 
     16#  with this program; if not, write to the Free Software Foundation, Inc., 
     17#  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 
     18# 
     19#  $Id$ 
     20# 
     21 
     22=begin rdoc 
     23 
     24Unit tests for the Ipvpn model. 
     25 
     26=end 
     27 
    128require File.dirname(__FILE__) + '/../test_helper' 
    229 
    330class IpvpnTest < ActiveSupport::TestCase 
    4   # Replace this with your real tests. 
    5   def test_truth 
    6     assert true 
     31 
     32  # Test that a new object is not valid unless all its attributes are correctly set 
     33   
     34  def test_new_object_not_valid 
     35   
     36    new_ipvpn = Ipvpn.new 
     37    assert(!new_ipvpn.valid?, "A new Ipvpn object should not be valid without attributes set") 
     38 
     39    new_ipvpn.ipvpn_rd = "1:1" 
     40    new_ipvpn.ipvpn_name = "Test" 
     41    assert(new_ipvpn.valid?, "An Ipvpn object should be valid with its RD and name set") 
     42   
    743  end 
     44 
    845end