public ComputeChecksum ( TSDateCalculator timeStepUnit, short timeStepQuantity, System.DateTime blobStartDate, List |
||
timeStepUnit | TSDateCalculator | TSDateCalculator.TimeStepUnitCode value for Minute,Hour,Day,Week,Month, Year, or Irregular |
timeStepQuantity | short | The number of the given unit that defines the time step. /// For instance, if the time step is 6 hours long, then this value is 6. |
blobStartDate | System.DateTime | Date of the first time step in the BLOB |
traceList | List |
a list of trace object whose checksums have already been computed. |
리턴 | byte[] |
// This method is reused by the actual test methods that follow public Boolean ComputeTestChecksums( TSDateCalculator.TimeStepUnitCode u1, short q1, DateTime sDate1, List<ITimeSeriesTrace> traceList1, TSDateCalculator.TimeStepUnitCode u2, short q2, DateTime sDate2, List<ITimeSeriesTrace> traceList2) { TSLibrary tsLib = new TSLibrary(); byte[] b1 = tsLib.ComputeChecksum(u1, q1, sDate1, traceList1); byte[] b2 = tsLib.ComputeChecksum(u2, q2, sDate2, traceList2); Assert.IsTrue(b1.Length == 16); Assert.IsTrue(b2.Length == 16); for (int i = 0; i < b2.Length; i++) if (b1[i] != b2[i]) return false; return true; }
public void ComputeChecksum_Err1() { TSLibrary tsLib = new TSLibrary(); TSTrace traceObject = new TSTrace { TraceNumber = 1 }; try { byte[] blobData = tsLib.ComputeChecksum( TSDateCalculator.TimeStepUnitCode.Irregular, 3, IrregList1.First().Date, new List<ITimeSeriesTrace>()); Assert.Fail("Should have thrown exception"); } catch (TSLibraryException e) { Assert.AreEqual(ErrCode.Enum.Checksum_Quantity_Nonzero, e.ErrCode); } }