public GetRemotePath ( IMappedObject obj ) : string | ||
obj | IMappedObject | /// The MappedObject instance. /// |
리턴 | string |
public string GetRemotePath(IMappedObject obj) {
string id = this.GetId(obj);
using(var tran = this.engine.GetTransaction()) {
string[] segments = this.GetRelativePathSegments(tran, id);
StringBuilder pathBuilder = new StringBuilder(this.matcher.RemoteTargetRootPath);
foreach (var name in segments) {
pathBuilder.Append("/").Append(name);
}
return this.slashRegex.Replace(pathBuilder.ToString(), @"/");
}
}
public void GetRemotePathThrowsExceptionOnNonExistingIdInObject([Values(true, false)]bool withValidation) { var storage = new MetaDataStorage(this.engine, this.matcher, withValidation); Assert.Throws<ArgumentException>(() => storage.GetRemotePath(Mock.Of<IMappedObject>())); }