/*--------------------------------------------------------------------------------------------*/ private void AssertFault(TestDelegate pDelegate, LoginErrors pError, LoginErrorDescs pDesc) { OauthException oe = TestUtil.Throws <OauthException>(pDelegate); Assert.NotNull(oe.OauthError, "OauthError should filled."); Assert.AreEqual(pError + "", oe.OauthError.Error, "Invalid OauthError.Error"); Assert.AreEqual(OauthLoginTasks.ErrDescStrings[(int)pDesc] + "", oe.OauthError.ErrorDesc, "Invalid OauthError.ErrorDesc"); }
/*--------------------------------------------------------------------------------------------*/ private void AssertFault(LoginErrors pError, LoginErrorDescs pDesc) { var oe = new OauthException(null, null); vMockTasks .Setup(x => x.NewFault(pError, pDesc)) .Returns(oe); OauthException thrown = TestUtil.Throws <OauthException>(DoExecute); Assert.AreEqual(oe, thrown, "Incorrect thrown OauthException."); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public OauthException NewFault(LoginErrors pErr, LoginErrorDescs pDesc) { return(new OauthException(pErr.ToString(), ErrDescStrings[(int)pDesc])); }
/*--------------------------------------------------------------------------------------------*/ public static void CheckException(OauthException pEx, LoginErrors pErr, LoginErrorDescs pDesc) { Assert.AreEqual(pErr.ToString(), pEx.OauthError.Error, "Incorrect Error."); Assert.AreEqual(OauthLoginTasks.ErrDescStrings[(int)pDesc], pEx.OauthError.ErrorDesc, "Incorrect ErrorDesc."); }