Esempio n. 1
0
 def test600_080ShouldCalculateLowNHighT2EdgeCase(self):
     myT = T.TCurve(3)
     self.assertAlmostEquals(myT.p(5.8409, 2), .99, 3)
Esempio n. 2
0
 def test600_100ShouldCalculateHighHighT2TailEdgeCase(self):
     myT = T.TCurve(20)
     self.assertAlmostEquals(myT.p(2.8453, 2), .99, 3)
Esempio n. 3
0
 def test100_010_ShouldConstruct(self):
     self.assertIsInstance(T.TCurve(self.nominalN), T.TCurve)
     # additional tests are for boundary value coverage
     self.assertIsInstance(T.TCurve(2), T.TCurve)
     self.assertIsInstance(T.TCurve(29), T.TCurve)
Esempio n. 4
0
 def test500_001TDD(self):
     myT = T.TCurve(self.nominalN)
     t = 1.0
     n = 1234  #n doesnt matter yet
     integratedVal = 0.85555275
     self.assertAlmostEquals(myT.integrate(t, n, myT.f), integratedVal, 3)
Esempio n. 5
0
 def test200_030_ShouldWorkOnHalfX(self):
     myT = T.TCurve(self.nominalN)
     self.assertAlmostEquals(myT.gamma(5.0 / 2.0), 1.329, 3)
Esempio n. 6
0
 def test400_010_ShouldCalculateFStarterCase(self):
     myT = T.TCurve(self.nominalN)
     self.assertAlmostEquals(myT.f(0, 5), 1, 4)
Esempio n. 7
0
 def test500_030_shouldCalculateIntegrateWhenF3(self):
     myT = T.TCurve(self.nominalN)
     self.assertAlmostEquals(myT.integrate(1.0, 5, myT.f3), 0.142857,4)
Esempio n. 8
0
 def test200_020_ShouldReturnLowerTerminationCondition(self):
     myT = T.TCurve(self.nominalN)
     self.assertEquals(myT.gamma(1.0 / 2.0), math.sqrt(math.pi))
Esempio n. 9
0
 def test500_010_shouldCalculateIntegrateWhenF1(self):
     myT = T.TCurve(self.nominalN)
     self.assertEquals(myT.integrate(1.0, 5, myT.f1), 0.5)
Esempio n. 10
0
 def test500_020_shouldCalculateIntegrateWhenF2(self):
     myT = T.TCurve(self.nominalN)
     self.assertAlmostEquals(myT.integrate(1.0, 5, myT.f2), 0.333333,4)
Esempio n. 11
0
 def test600_102ShouldCalculatePTestcase2Tail(self):
     myT = T.TCurve(9)
     self.assertAlmostEquals(myT.p(1.8331, 2), .9, 3)
Esempio n. 12
0
 def test600_101ShouldCalculatePTestcase1Tail(self):
     myT = T.TCurve(5)
     self.assertAlmostEquals(myT.p(1.1558, 1), .85, 3)
Esempio n. 13
0
 def test500_101IntegrationOnF(self):
     myT = T.TCurve(self.nominalN)
     t = 1.8946
     n = 7
     integratedVal = 1.1694779
     self.assertAlmostEquals(myT.integrate(t, n, myT.f), integratedVal, 3)
Esempio n. 14
0
 def test600_930ShouldRaiseExceptionInvalidTails(self):
     myT = T.TCurve(self.nominalN)
     with self.assertRaises(ValueError) as context:
         myT.p(t=self.nominalT, tails=0)
Esempio n. 15
0
 def test500_040_shouldCalculateIntegrateWhenF4(self):
     myT = T.TCurve(self.nominalN)
     self.assertAlmostEquals(myT.integrate(1.0, 5, myT.f4), 0.009901,4)
     
Esempio n. 16
0
 def test200_010_ShouldReturnUpperTerminationCondition(self):
     myT = T.TCurve(self.nominalN)
     self.assertEquals(myT.gamma(1), 1)
Esempio n. 17
0
 def test600_930ShouldRaiseExceptionOnNonNumericT(self):
     expectedString = "TCurve.p:"
     myT = T.TCurve(self.nominalN)
     with self.assertRaises(ValueError) as context:
         myT.p(t= "abc", tails=1)                       
     self.assertEquals(expectedString, context.exception.args[0][0:len(expectedString)]) 
Esempio n. 18
0
 def test200_030_ShouldWorkOnIntegerX(self):
     myT = T.TCurve(self.nominalN)
     self.assertEquals(myT.gamma(5), 24)
Esempio n. 19
0
 def test600_020ShouldCalculateNominalCase2Tail(self):
     myT = T.TCurve(7)
     self.assertAlmostEquals(myT.p(1.8946, 2), .90, 3)
Esempio n. 20
0
 def test300_010_ShouldCalculateLHP(self):
     myT = T.TCurve(self.nominalN)
     self.assertAlmostEquals(myT.calculateConstant(5), 0.37960669, 4)
Esempio n. 21
0
 def test600_040ShouldCalculateLowNLowT2TailEdgeCase(self):
     myT = T.TCurve(3)
     self.assertAlmostEquals(myT.p(0.2767, 2), 0.2, 3)
Esempio n. 22
0
 def test400_020_ShouldCalculateF(self):
     myT = T.TCurve(self.nominalN)
     self.assertAlmostEquals(myT.f(1, 5), 0.578703704)
Esempio n. 23
0
 def test600_060ShouldCalculateHighNLowT2TailEdgeCase(self):
     myT = T.TCurve(20)
     self.assertAlmostEquals(myT.p(0.2567, 2), 0.2, 3)
Esempio n. 24
0
 def test100_940_ShouldRaiseExceptionOnMissingN(self):
     expectedString = "TCurve.__init__:"
     with self.assertRaises(ValueError) as context:
         T.TCurve()
     self.assertEquals(expectedString,
                       context.exception.args[0][0:len(expectedString)])
Esempio n. 25
0
 def test501_003IntegrationOnF2(self):
     myT = T.TCurve(self.nominalN)
     t = 16.0
     n = 1234  #n doesnt matter for f2
     integratedVal = 1365.3333333
     self.assertAlmostEquals(myT.integrate(t, n, myT.f2), integratedVal, 3)