public bool PosTest1() { bool retVal = true; TestLibrary.TestFramework.BeginScenario("PosTest1: Call GetHashCode on a valid instance"); try { DateTime t = new DateTime(2006, 9, 25, 14, 15, 59, 999); int hashCode1 = t.GetHashCode(); int hashCode2 = t.GetHashCode(); if (hashCode1 != hashCode2) { TestLibrary.TestFramework.LogError("001.1", "Call GetHashCode on a valid instance twice does not return the same hash code"); TestLibrary.TestFramework.LogInformation("WARNING [LOCAL VARIABLES] hashCode1 = " + hashCode1 + ", hashCode2 = " + hashCode2); retVal = false; } } catch (Exception e) { TestLibrary.TestFramework.LogError("001.0", "Unexpected exception: " + e); TestLibrary.TestFramework.LogInformation(e.StackTrace); retVal = false; } return retVal; }
public virtual Boolean runTest() { Console.Error.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver " + s_strDtTmVer); int iCountErrors = 0; int iCountTestcases = 0; String strLoc = "Loc_000oo"; String strBaseLoc; DateTime dt1 ; DateTime dt2 ; String strInput1; String strInput2; Int64 in8a; try { LABEL_860_GENERAL: do { strLoc = "Loc_111ji"; dt1 = DateTime.Parse("01/01/1999 00:00:00"); dt2 = DateTime.Parse("01/01/1999 00:00:01"); iCountTestcases++; if(dt1.GetHashCode() == dt2.GetHashCode()) { iCountErrors++; Console.WriteLine( s_strTFAbbrev+ "Err_128nu!"); } dt1 = new DateTime(2000, 08, 15, 9, 0, 1); dt2 = new DateTime(2000, 08, 15, 9, 0, 1); iCountTestcases++; if(dt1.GetHashCode() != dt2.GetHashCode()) { iCountErrors++; Console.WriteLine( s_strTFAbbrev+ "Err_128nu!"); } } while (false); } catch (Exception exc_general ) { ++iCountErrors; Console.WriteLine(s_strTFAbbrev +" Error Err_8888yyy! strLoc=="+ strLoc +", exc_general=="+exc_general); } if ( iCountErrors == 0 ) { Console.Error.WriteLine( "paSs. "+s_strTFPath +" "+s_strTFName+" ,iCountTestcases=="+iCountTestcases); return true; } else { Console.Error.WriteLine("FAiL! "+s_strTFPath+" "+s_strTFName+" ,iCountErrors=="+iCountErrors+" , BugNums?: "+s_strActiveBugNums ); return false; } }
public static string GetDocKey(object fileId, int fileVersion, DateTime modified) { var str = string.Format("teamlab_{0}_{1}_{2}_{3}", fileId, fileVersion, modified.GetHashCode(), GetDocDbKey()); var keyDoc = Encoding.UTF8.GetBytes(str) .ToList() .Concat(MachinePseudoKeys.GetMachineConstant()) .ToArray(); return Global.InvalidTitleChars.Replace(Hasher.Base64Hash(keyDoc, HashAlg.SHA256), "_"); }
internal Value(System.DateTime value, Parameterization p = Parameterization.Value, DataType dataType = null) : base(value) { Original = value; _clrType = typeof(System.DateTime); _hashCode = GetCrossTypeHashCode(_clrType, value.GetHashCode()); dataType = dataType ?? Mapping.DefaultDateTimeType; // build Build = (buildContext, buildArgs) => { return((p != Parameterization.None) ? (value.Parameterize(buildContext, dataType, p) ?? Mapping.BuildCast(value, dataType)) : Mapping.BuildCast(value, dataType)); }; }
public override int GetHashCode() { return(dateStart.GetHashCode() ^ dateEnd.GetHashCode() ^ daylightDelta.GetHashCode() ^ daylightTransitionStart.GetHashCode() ^ daylightTransitionEnd.GetHashCode()); }
public override int GetHashCode() { return(_internal.GetHashCode()); }
public void Add(DateTime dt) { Add(dt.GetHashCode()); }
private static string GetDateTimeHash(DateTime dateTime) { int hash = dateTime.GetHashCode(); return Convert.ToBase64String(BitConverter.GetBytes(hash)).Substring(0, 6).Replace('+', '-').Replace('/', '_'); }
public override int GetHashCode() => Date.GetHashCode();
internal void AddDateTime(DateTime d) { AddInt(d.GetHashCode()); }
String ArticleUrl(String filePath, DateTime lastWriteTime) { var vpath = filePath.Substring(OutputPath.Length).Replace(Path.DirectorySeparatorChar, '/'); return DextopUtil.AbsolutePath(DextopUtil.CombinePaths("guides/html", vpath)) + "?cb=" + Math.Abs(lastWriteTime.GetHashCode()); }
public static int HashThis(string chId, DateTime start) { int hash1 = start.GetHashCode(); int finalHash = chId.GetHashCode() ^ hash1; return finalHash != 0 ? finalHash : hash1; }
private static string BuildCacheKey(object dependency1, object dependency2, DateTime dependentDate) { long key; unchecked { key = dependency1?.GetHashCode() ?? 1 * dependency2?.GetHashCode() ?? 1 * dependentDate.GetHashCode(); } var keyString = key.ToString(CultureInfo.InvariantCulture); return keyString; }
public override int GetHashCode() { return(name.GetHashCode() * surname.GetHashCode() * birthday.GetHashCode()); }
public override int GetHashCode() { return(dt.GetHashCode() ^ utc_offset.GetHashCode()); }
public static string GetDocKey(object fileId, int fileVersion, DateTime modified) { var str = String.Format("teamlab_{0}_{1}_{2}_{3}", fileId, fileVersion, modified.GetHashCode(), Global.GetDocDbKey()); var keyDoc = Encoding.UTF8.GetBytes(str) .ToList() .Concat(MachinePseudoKeys.GetMachineConstant()) .ToArray(); return DocumentServiceConnector.GenerateRevisionId(Hasher.Base64Hash(keyDoc, HashAlg.SHA256)); }
public override int GetHashCode() { return(name.GetHashCode() + secondname.GetHashCode() + DateOfBirth.GetHashCode()); }
/// <inheritdoc /> public override int GetHashCode() { return(_dateTime.GetHashCode()); }
public override int GetHashCode() { return(myValue.GetHashCode() ^ timezone.GetHashCode()); }
public static int GetHash(DateTime/*!*/ self) { return self.GetHashCode(); }
public override int GetHashCode() { return(name.GetHashCode() ^ secondname.GetHashCode() ^ mydate.GetHashCode()); }
public override int GetHashCode() => _dateStart.GetHashCode();
public override int GetHashCode() { return(value.GetHashCode()); }