private static void CheckPropertyDoesNotExistBeforeUpGrade(MetadataCache mdc, string className, string newPropName) { var classInfo = mdc.GetClassInfo(className); var newProperty = (from propInfo in classInfo.AllProperties where propInfo.PropertyName == newPropName select propInfo).FirstOrDefault(); Assert.IsNull(newProperty, string.Format("{0} {1} should not exist yet.", className, newPropName)); }
private static void CheckPropertyRemovedAfterUpGrade(MetadataCache mdc, string className, string removedPropName) { var classInfo = mdc.GetClassInfo(className); var newProperty = (from propInfo in classInfo.AllProperties where propInfo.PropertyName == removedPropName select propInfo).FirstOrDefault(); Assert.IsNull(newProperty, string.Format("{0} {1} should not exist, after upgrade.", className, removedPropName)); }
private static void CheckPropertyExistsBeforeUpGrade(MetadataCache mdc, string className, string extantPropName) { var classInfo = mdc.GetClassInfo(className); var newProperty = (from propInfo in classInfo.AllProperties where propInfo.PropertyName == extantPropName select propInfo).FirstOrDefault(); Assert.IsNotNull(newProperty, string.Format("{0} {1} should exist, before upgrade.", className, extantPropName)); }
private static void CheckClassDoesNotExistBeforeUpGrade(MetadataCache mdc, string className) { Assert.IsNull(mdc.GetClassInfo(className)); }
private static void CheckSinglePropertyAddedUpgrade(MetadataCache mdc, IChorusFileTypeHandler fileHandler, int ours, string className, string newPropName, DataType dataType) { CheckPropertyDoesNotExistBeforeUpGrade(mdc, className, newPropName); DoMerge(fileHandler, ours); CheckNewPropertyAfterUpgrade(mdc.GetClassInfo(className), newPropName, dataType); }
private static FdoClassInfo CheckClassDoesExistAfterUpGrade(MetadataCache mdc, FdoClassInfo superclass, string newClassname) { var result = mdc.GetClassInfo(newClassname); Assert.IsNotNull(result); Assert.AreSame(superclass, result.Superclass); return result; }