public void FxCopLogReader_Context_RefineExceptionMessage() { FxCopLogReader.Context context = TestHelper.CreateProjectContext(); context.RefineExceptionMessage("mymessage"); Assert.Equal("mymessage", context.ExceptionMessage); }
public void FxCopLogReader_Context_RefineProjectToExceptionIssue() { FxCopLogReader.Context context = TestHelper.CreateProjectContext(); context.RefineException(true, "CA0001", "binary.dll#namespace#member(string)"); context.RefineExceptionType("type"); context.RefineExceptionMessage("message"); context.RefineStackTrace("trace"); context.RefineInnerExceptionType("innertype"); context.RefineInnerExceptionMessage("innermessage"); context.RefineInnerStackTrace("innertrace"); string exception = FxCopLogReader.MakeExceptionMessage("Rule", "CA1000", context.ExceptionType, context.ExceptionMessage, context.StackTrace, context.InnerExceptionType, context.InnerExceptionMessage, context.InnerStackTrace); context.RefineIssue(exception, null, null, null, null, null, null); Assert.Equal("Rule CA1000 exception: type: message trace. Inner Exception: innertype: innermessage innertrace", context.Message); Assert.Equal("binary.dll#namespace#member(string)", context.ExceptionTarget); context.ClearException(); Assert.Null(context.Target); Assert.Null(context.Module); Assert.Null(context.Namespace); Assert.Null(context.Type); Assert.Null(context.Member); Assert.Null(context.Message); Assert.Null(context.ResolutionName); Assert.False(context.Exception); Assert.Null(context.ExceptionType); Assert.Null(context.ExceptionMessage); Assert.Null(context.StackTrace); Assert.Null(context.InnerExceptionType); Assert.Null(context.InnerExceptionMessage); Assert.Null(context.InnerStackTrace); }