public void IsFactoryDereferenceSunnyDay() { Assert.IsTrue(ObjectFactoryUtils.IsFactoryDereference( ObjectFactoryUtils.FactoryObjectPrefix + "roob"), "Name that did start with the factory object prefix is not being reported " + "(incorrectly) as a factory object dereference."); }
public void IsFactoryDereferenceWithJustTheFactoryObjectPrefixCharacter() { Assert.IsFalse(ObjectFactoryUtils.IsFactoryDereference( ObjectFactoryUtils.FactoryObjectPrefix), "Name that consisted solely of the factory object prefix is being reported " + "(incorrectly) as a factory object dereference."); }
/// <summary> /// Return the object name, stripping out the factory dereference prefix if necessary. /// </summary> /// <param name="name">The name of the object.</param> /// <returns>The object name sans any factory dereference prefix.</returns> public static string TransformedObjectName(string name) { AssertUtils.ArgumentNotNull(name, "name", "Object name must not be null."); if (!ObjectFactoryUtils.IsFactoryDereference(name)) { return(name); } string objectName = name.Substring(ObjectFactoryUtils.FactoryObjectPrefix.Length); return(objectName); }
public void IsFactoryDereferenceWithEmptyName() { Assert.IsFalse(ObjectFactoryUtils.IsFactoryDereference(string.Empty), "String.Empty name that (obviously) didn't start with the factory object prefix is being reported " + "(incorrectly) as a factory object dereference."); }
public void IsFactoryDereferenceWithNonFactoryObjectName() { Assert.IsFalse(ObjectFactoryUtils.IsFactoryDereference("roob"), "Name that didn't start with the factory object prefix is being reported " + "(incorrectly) as a factory object dereference."); }