public void UpdateTest() { string path = Constants.AF_ANALYSIS_RULE_PATH; AFAnalysisRule myAnalysisRule = AFObject.FindObject(path) as AFAnalysisRule; string oldConfigString = myAnalysisRule.ConfigString; PIAnalysisRule analysisRule = instance.GetByPath(path, null); analysisRule.Name = null; analysisRule.Description = null; analysisRule.DisplayString = null; analysisRule.EditorType = null; analysisRule.HasChildren = null; analysisRule.PlugInName = null; analysisRule.SupportedBehaviors = null; analysisRule.Path = null; analysisRule.IsConfigured = null; analysisRule.IsInitializing = null; analysisRule.WebId = null; analysisRule.Links = null; analysisRule.Id = null; analysisRule.ConfigString = "Avg2d := TagAvg('Temperature','*-4d','*');\r\nAvg1d := TagAvg('Temperature','*-3d','*');\r\nSumAvg := Avg1d+Avg2d+2;"; instance.Update(webId, analysisRule); //StandardPISystem.Databases[Constants.AF_DATABASE_NAME].Refresh(); myAnalysisRule.RefreshConfigurationAndVariableMapping(); Assert.IsFalse(oldConfigString == analysisRule.ConfigString); }
public void DeleteTest() { instance.Delete(webId); StandardPISystem.Refresh(); string path = Constants.AF_ANALYSIS_RULE_PATH; AFAnalysisRule myAnalysisRule = AFObject.FindObject(path) as AFAnalysisRule; Assert.IsNull(myAnalysisRule); }