public void Exception_ToString() { var innerException = new InvalidOperationException("innerMsg"); MsalException ex = new MsalException("errCode", "errMessage", innerException); Assert.IsTrue(ex.ToString().Contains("errCode")); Assert.IsTrue(ex.ToString().Contains("errMessage")); Assert.IsTrue(ex.ToString().Contains("innerMsg")); }
private static void ValidateExceptionProductInformation(MsalException exception) { string exceptionString = exception.ToString(); string msalProductName = PlatformProxyFactory.CreatePlatformProxy(null).GetProductName(); string msalVersion = MsalIdHelper.GetMsalVersion(); Assert.IsTrue(exceptionString.Contains(msalProductName), "Exception should contain the msalProductName"); Assert.IsTrue(exceptionString.Contains(msalVersion), "Exception should contain the msalVersion"); }