[TestCase("fffffff28449cf3", "123456", "testmachine", true)] // same public void Continue_Refreshing_For_Request(string hash, string appDomainAppId, string machineName, bool expected) { if (expected) { Assert.IsTrue(Continue(hash, WebServiceServerMessenger.GetServerHash(appDomainAppId, machineName))); } else { Assert.IsFalse(Continue(hash, WebServiceServerMessenger.GetServerHash(appDomainAppId, machineName))); } }
// is the server originating from this server - ie are we self-messaging? // in which case we should ignore the message because it's been processed locally already internal static bool SelfMessage(string hash) { if (string.IsNullOrEmpty(hash)) { return(false); // no hash = don't know = not self } if (hash != WebServiceServerMessenger.GetCurrentServerHash()) { return(false); } LogHelper.Debug <CacheRefresher>( "Ignoring self-message. (server: {0}, appId: {1}, hash: {2})", () => NetworkHelper.MachineName, () => HttpRuntime.AppDomainAppId, () => hash); return(true); }