public static Validate ( TelemetryItem |
||
itemToValidate | TelemetryItem |
RDD Item to be validated. |
accessTimeMax | TimeSpan | Expected maximum limit for access time. |
successFlagExpected | bool | Expected value for success flag. |
리턴 | void |
private static void Validate(TelemetryItem <RemoteDependencyData> itemToValidate, string targetExpected, string commandNameExpected, TimeSpan accessTimeMax, bool successFlagExpected, string sqlErrorCodeExpected, string sqlErrorMessageExpected) { Assert.IsTrue(itemToValidate.data.baseData.target.Contains(targetExpected), "The remote dependancy target is incorrect. Expected: " + targetExpected + ". Collected: " + itemToValidate.data.baseData.target); Assert.AreEqual(sqlErrorCodeExpected, itemToValidate.data.baseData.resultCode); //If the command name is expected to be empty, the deserializer will make the CommandName null if ("rdddsc" == DeploymentAndValidationTools.ExpectedSqlSDKPrefix) { // Additional checks for profiler collection if (!string.IsNullOrEmpty(sqlErrorMessageExpected)) { Assert.AreEqual(sqlErrorMessageExpected, itemToValidate.data.baseData.properties["ErrorMessage"]); } if (string.IsNullOrEmpty(commandNameExpected)) { Assert.IsNull(itemToValidate.data.baseData.data); } else { Assert.AreEqual(commandNameExpected, itemToValidate.data.baseData.data, "The command name is incorrect"); } } DeploymentAndValidationTools.Validate(itemToValidate, accessTimeMax, successFlagExpected, sqlErrorCodeExpected); }
public static void Validate(TelemetryItem <RemoteDependencyData> itemToValidate, Uri expectedUrl, TimeSpan accessTimeMax, bool successFlagExpected, string verb, string resultCodeExpected) { if ("rddp" == DeploymentAndValidationTools.ExpectedSDKPrefix) { Assert.AreEqual(verb + " " + expectedUrl.AbsolutePath, itemToValidate.data.baseData.name, "For StatusMonitor implementation we expect verb to be collected."); Assert.AreEqual(expectedUrl.Host, itemToValidate.data.baseData.target); Assert.AreEqual(expectedUrl.OriginalString, itemToValidate.data.baseData.data); } DeploymentAndValidationTools.Validate(itemToValidate, accessTimeMax, successFlagExpected, resultCodeExpected); }