#! /usr/bin/ruby require "helper" class TC_Povray_Element < Test::Unit::TestCase CPE = CrystalCell::Povray::Element def setup end def test_draw_radius assert_equal(0.2 , CPE.draw_radius(1 )) assert_equal(1.22 , CPE.draw_radius(2 )) assert_equal(0.59 , CPE.draw_radius(3 )) assert_equal(0.27 , CPE.draw_radius(4 )) assert_equal(0.11 , CPE.draw_radius(5 )) assert_equal(0.15 , CPE.draw_radius(6 )) assert_equal(1.46 , CPE.draw_radius(7 )) assert_equal(1.4 , CPE.draw_radius(8 )) assert_equal(1.33 , CPE.draw_radius(9 )) assert_equal(1.6 , CPE.draw_radius(10 )) assert_equal(1.02 , CPE.draw_radius(11 )) assert_equal(0.72 , CPE.draw_radius(12 )) assert_equal(0.39 , CPE.draw_radius(13 )) assert_equal(0.26 , CPE.draw_radius(14 )) assert_equal(0.17 , CPE.draw_radius(15 )) assert_equal(1.84 , CPE.draw_radius(16 )) assert_equal(1.81 , CPE.draw_radius(17 )) assert_equal(1.92 , CPE.draw_radius(18 )) assert_equal(1.51 , CPE.draw_radius(19 )) assert_equal(1.12 , CPE.draw_radius(20 )) assert_equal(0.745, CPE.draw_radius(21 )) assert_equal(0.605, CPE.draw_radius(22 )) assert_equal(0.58 , CPE.draw_radius(23 )) assert_equal(0.615, CPE.draw_radius(24 )) assert_equal(0.83 , CPE.draw_radius(25 )) assert_equal(0.78 , CPE.draw_radius(26 )) assert_equal(0.745, CPE.draw_radius(27 )) assert_equal(0.69 , CPE.draw_radius(28 )) assert_equal(0.73 , CPE.draw_radius(29 )) assert_equal(0.74 , CPE.draw_radius(30 )) assert_equal(0.62 , CPE.draw_radius(31 )) assert_equal(0.53 , CPE.draw_radius(32 )) assert_equal(0.335, CPE.draw_radius(33 )) assert_equal(1.98 , CPE.draw_radius(34 )) assert_equal(1.96 , CPE.draw_radius(35 )) assert_equal(1.98 , CPE.draw_radius(36 )) assert_equal(1.61 , CPE.draw_radius(37 )) assert_equal(1.26 , CPE.draw_radius(38 )) assert_equal(1.019, CPE.draw_radius(39 )) assert_equal(0.72 , CPE.draw_radius(40 )) assert_equal(0.64 , CPE.draw_radius(41 )) assert_equal(0.59 , CPE.draw_radius(42 )) assert_equal(0.56 , CPE.draw_radius(43 )) assert_equal(0.62 , CPE.draw_radius(44 )) assert_equal(0.665, CPE.draw_radius(45 )) assert_equal(0.86 , CPE.draw_radius(46 )) assert_equal(1.15 , CPE.draw_radius(47 )) assert_equal(0.95 , CPE.draw_radius(48 )) assert_equal(0.8 , CPE.draw_radius(49 )) assert_equal(0.69 , CPE.draw_radius(50 )) assert_equal(0.76 , CPE.draw_radius(51 )) assert_equal(2.21 , CPE.draw_radius(52 )) assert_equal(2.2 , CPE.draw_radius(53 )) assert_equal(0.48 , CPE.draw_radius(54 )) assert_equal(1.74 , CPE.draw_radius(55 )) assert_equal(1.42 , CPE.draw_radius(56 )) assert_equal(1.16 , CPE.draw_radius(57 )) assert_equal(0.97 , CPE.draw_radius(58 )) assert_equal(1.126, CPE.draw_radius(59 )) assert_equal(1.109, CPE.draw_radius(60 )) assert_equal(1.093, CPE.draw_radius(61 )) assert_equal(1.27 , CPE.draw_radius(62 )) assert_equal(1.066, CPE.draw_radius(63 )) assert_equal(1.053, CPE.draw_radius(64 )) assert_equal(1.04 , CPE.draw_radius(65 )) assert_equal(1.027, CPE.draw_radius(66 )) assert_equal(1.015, CPE.draw_radius(67 )) assert_equal(1.004, CPE.draw_radius(68 )) assert_equal(0.994, CPE.draw_radius(69 )) assert_equal(0.985, CPE.draw_radius(70 )) assert_equal(0.977, CPE.draw_radius(71 )) assert_equal(0.71 , CPE.draw_radius(72 )) assert_equal(0.64 , CPE.draw_radius(73 )) assert_equal(0.6 , CPE.draw_radius(74 )) assert_equal(0.53 , CPE.draw_radius(75 )) assert_equal(0.63 , CPE.draw_radius(76 )) assert_equal(0.625, CPE.draw_radius(77 )) assert_equal(0.625, CPE.draw_radius(78 )) assert_equal(1.37 , CPE.draw_radius(79 )) assert_equal(1.02 , CPE.draw_radius(80 )) assert_equal(0.885, CPE.draw_radius(81 )) assert_equal(1.19 , CPE.draw_radius(82 )) assert_equal(1.03 , CPE.draw_radius(83 )) assert_equal(0.94 , CPE.draw_radius(84 )) assert_equal(0.62 , CPE.draw_radius(85 )) assert_equal(0.8 , CPE.draw_radius(86 )) assert_equal(1.8 , CPE.draw_radius(87 )) assert_equal(1.48 , CPE.draw_radius(88 )) assert_equal(1.12 , CPE.draw_radius(89 )) assert_equal(1.05 , CPE.draw_radius(90 )) assert_equal(0.78 , CPE.draw_radius(91 )) assert_equal(0.73 , CPE.draw_radius(92 )) assert_equal(0.75 , CPE.draw_radius(93 )) assert_equal(0.86 , CPE.draw_radius(94 )) assert_equal(0.975, CPE.draw_radius(95 )) assert_equal(0.8 , CPE.draw_radius(96 )) assert_equal(0.8 , CPE.draw_radius(97 )) assert_equal(0.8 , CPE.draw_radius(98 )) assert_equal(0.8 , CPE.draw_radius(99 )) assert_equal(0.8 , CPE.draw_radius(100 )) assert_equal(0.8 , CPE.draw_radius(101 )) assert_equal(0.8 , CPE.draw_radius(102 )) assert_equal(0.8 , CPE.draw_radius(103 )) assert_equal(0.2 , CPE.draw_radius( 'H' )) assert_equal(1.22 , CPE.draw_radius( 'He' )) assert_equal(0.59 , CPE.draw_radius( 'Li' )) assert_equal(0.27 , CPE.draw_radius( 'Be' )) assert_equal(0.11 , CPE.draw_radius( 'B' )) assert_equal(0.15 , CPE.draw_radius( 'C' )) assert_equal(1.46 , CPE.draw_radius( 'N' )) assert_equal(1.4 , CPE.draw_radius( 'O' )) assert_equal(1.33 , CPE.draw_radius( 'F' )) assert_equal(1.6 , CPE.draw_radius( 'Ne' )) assert_equal(1.02 , CPE.draw_radius( 'Na' )) assert_equal(0.72 , CPE.draw_radius( 'Mg' )) assert_equal(0.39 , CPE.draw_radius( 'Al' )) assert_equal(0.26 , CPE.draw_radius( 'Si' )) assert_equal(0.17 , CPE.draw_radius( 'P' )) assert_equal(1.84 , CPE.draw_radius( 'S' )) assert_equal(1.81 , CPE.draw_radius( 'Cl' )) assert_equal(1.92 , CPE.draw_radius( 'Ar' )) assert_equal(1.51 , CPE.draw_radius( 'K' )) assert_equal(1.12 , CPE.draw_radius( 'Ca' )) assert_equal(0.745, CPE.draw_radius( 'Sc' )) assert_equal(0.605, CPE.draw_radius( 'Ti' )) assert_equal(0.58 , CPE.draw_radius( 'V' )) assert_equal(0.615, CPE.draw_radius( 'Cr' )) assert_equal(0.83 , CPE.draw_radius( 'Mn' )) assert_equal(0.78 , CPE.draw_radius( 'Fe' )) assert_equal(0.745, CPE.draw_radius( 'Co' )) assert_equal(0.69 , CPE.draw_radius( 'Ni' )) assert_equal(0.73 , CPE.draw_radius( 'Cu' )) assert_equal(0.74 , CPE.draw_radius( 'Zn' )) assert_equal(0.62 , CPE.draw_radius( 'Ga' )) assert_equal(0.53 , CPE.draw_radius( 'Ge' )) assert_equal(0.335, CPE.draw_radius( 'As' )) assert_equal(1.98 , CPE.draw_radius( 'Se' )) assert_equal(1.96 , CPE.draw_radius( 'Br' )) assert_equal(1.98 , CPE.draw_radius( 'Kr' )) assert_equal(1.61 , CPE.draw_radius( 'Rb' )) assert_equal(1.26 , CPE.draw_radius( 'Sr' )) assert_equal(1.019, CPE.draw_radius( 'Y' )) assert_equal(0.72 , CPE.draw_radius( 'Zr' )) assert_equal(0.64 , CPE.draw_radius( 'Nb' )) assert_equal(0.59 , CPE.draw_radius( 'Mo' )) assert_equal(0.56 , CPE.draw_radius( 'Tc' )) assert_equal(0.62 , CPE.draw_radius( 'Ru' )) assert_equal(0.665, CPE.draw_radius( 'Rh' )) assert_equal(0.86 , CPE.draw_radius( 'Pd' )) assert_equal(1.15 , CPE.draw_radius( 'Ag' )) assert_equal(0.95 , CPE.draw_radius( 'Cd' )) assert_equal(0.8 , CPE.draw_radius( 'In' )) assert_equal(0.69 , CPE.draw_radius( 'Sn' )) assert_equal(0.76 , CPE.draw_radius( 'Sb' )) assert_equal(2.21 , CPE.draw_radius( 'Te' )) assert_equal(2.2 , CPE.draw_radius( 'I' )) assert_equal(0.48 , CPE.draw_radius( 'Xe' )) assert_equal(1.74 , CPE.draw_radius( 'Cs' )) assert_equal(1.42 , CPE.draw_radius( 'Ba' )) assert_equal(0.71 , CPE.draw_radius( 'Hf' )) assert_equal(0.64 , CPE.draw_radius( 'Ta' )) assert_equal(0.6 , CPE.draw_radius( 'W' )) assert_equal(0.53 , CPE.draw_radius( 'Re' )) assert_equal(0.63 , CPE.draw_radius( 'Os' )) assert_equal(0.625, CPE.draw_radius( 'Ir' )) assert_equal(0.625, CPE.draw_radius( 'Pt' )) assert_equal(1.37 , CPE.draw_radius( 'Au' )) assert_equal(1.02 , CPE.draw_radius( 'Hg' )) assert_equal(0.885, CPE.draw_radius( 'Tl' )) assert_equal(1.19 , CPE.draw_radius( 'Pb' )) assert_equal(1.03 , CPE.draw_radius( 'Bi' )) assert_equal(0.94 , CPE.draw_radius( 'Po' )) assert_equal(0.62 , CPE.draw_radius( 'At' )) assert_equal(0.8 , CPE.draw_radius( 'Rn' )) assert_equal(1.8 , CPE.draw_radius( 'Fr' )) assert_equal(1.48 , CPE.draw_radius( 'Ra' )) assert_equal(1.16 , CPE.draw_radius( 'La' )) assert_equal(0.97 , CPE.draw_radius( 'Ce' )) assert_equal(1.126, CPE.draw_radius( 'Pr' )) assert_equal(1.109, CPE.draw_radius( 'Nd' )) assert_equal(1.093, CPE.draw_radius( 'Pm' )) assert_equal(1.27 , CPE.draw_radius( 'Sm' )) assert_equal(1.066, CPE.draw_radius( 'Eu' )) assert_equal(1.053, CPE.draw_radius( 'Gd' )) assert_equal(1.04 , CPE.draw_radius( 'Tb' )) assert_equal(1.027, CPE.draw_radius( 'Dy' )) assert_equal(1.015, CPE.draw_radius( 'Ho' )) assert_equal(1.004, CPE.draw_radius( 'Er' )) assert_equal(0.994, CPE.draw_radius( 'Tm' )) assert_equal(0.985, CPE.draw_radius( 'Yb' )) assert_equal(0.977, CPE.draw_radius( 'Lu' )) assert_equal(1.12 , CPE.draw_radius( 'Ac' )) assert_equal(1.05 , CPE.draw_radius( 'Th' )) assert_equal(0.78 , CPE.draw_radius( 'Pa' )) assert_equal(0.73 , CPE.draw_radius( 'U' )) assert_equal(0.75 , CPE.draw_radius( 'Np' )) assert_equal(0.86 , CPE.draw_radius( 'Pu' )) assert_equal(0.975, CPE.draw_radius( 'Am' )) assert_equal(0.8 , CPE.draw_radius( 'Cm' )) assert_equal(0.8 , CPE.draw_radius( 'Bk' )) assert_equal(0.8 , CPE.draw_radius( 'Cf' )) assert_equal(0.8 , CPE.draw_radius( 'Es' )) assert_equal(0.8 , CPE.draw_radius( 'Fm' )) assert_equal(0.8 , CPE.draw_radius( 'Md' )) assert_equal(0.8 , CPE.draw_radius( 'No' )) assert_equal(0.8 , CPE.draw_radius( 'Lr' )) assert_equal(0.2 , CPE.draw_radius(1 )) assert_equal(1.22 , CPE.draw_radius(2 )) end def test_color assert_equal( [ 1.00, 0.80, 0.80 ], CPE.color('H' ) ) assert_equal( [ 1.00, 0.80, 0.80 ], CPE.color(1 ) ) end end