public void PassingTypeStringReturnsFirstSegmentAndTrimsSpaces() { ExceptionTypeNodeNameFormatter nameFormatter = new ExceptionTypeNodeNameFormatter(); ExceptionTypeData exceptionTypeData = new ExceptionTypeData("someName", " a, b, c, d", PostHandlingAction.NotifyRethrow); string name = nameFormatter.CreateName(exceptionTypeData); Assert.IsNotNull(name); Assert.AreEqual("a", name); }
public void PassingConfigurationWithNullTypeReturnsEmptyString() { ExceptionTypeNodeNameFormatter nameFormatter = new ExceptionTypeNodeNameFormatter(); ExceptionTypeData exceptionTypeData = new ExceptionTypeData("someName", (Type)null, PostHandlingAction.NotifyRethrow); string name = nameFormatter.CreateName(exceptionTypeData); Assert.IsNotNull(name); Assert.AreEqual(0, name.Length); }
public void PassingTypeReturnsTypeName() { ExceptionTypeNodeNameFormatter nameFormatter = new ExceptionTypeNodeNameFormatter(); ExceptionTypeData exceptionTypeData = new ExceptionTypeData("someName", typeof(Exception), PostHandlingAction.NotifyRethrow); string name = nameFormatter.CreateName(exceptionTypeData); Assert.IsNotNull(name); Assert.AreEqual("Exception", name); }
public void PassingNullConfigurationDataInCreateNameMethodTrows() { ExceptionTypeNodeNameFormatter nameFormatter = new ExceptionTypeNodeNameFormatter(); nameFormatter.CreateName((ExceptionTypeData)null); }