public void Test_SaveDeletedBO_Fail_AllowDelete_False() { //---------------Set up test pack------------------- MyBoAuthenticationStub.LoadDefaultClassDef(); IBusinessObjectAuthorisation authorisationStub = GetAuthorisationStub_CanDelete_False(); MyBoAuthenticationStub myBoStub = new MyBoAuthenticationStub(); myBoStub.SetAuthorisation(authorisationStub); myBoStub.Save(); myBoStub.SetStatus(BOStatus.Statuses.isDeleted, true); //---------------Assert Precondition---------------- Assert.IsFalse(authorisationStub.IsAuthorised(myBoStub, BusinessObjectActions.CanDelete)); Assert.IsTrue(myBoStub.Status.IsDeleted); Assert.IsFalse(myBoStub.Status.IsNew); //---------------Execute Test ---------------------- try { myBoStub.Save(); Assert.Fail("expected Err"); } //---------------Test Result ----------------------- catch (BusObjPersistException ex) { StringAssert.Contains("The logged on user", ex.Message); StringAssert.Contains("is not authorised to delete ", ex.Message); } }