public void TestConstructWithMessage() { var fixture = new GroupParticipantRemovalException("message"); Assert.AreEqual(fixture.Message, "message"); Assert.AreEqual(HttpStatusCode.InternalServerError, fixture.StatusCode); }
public void TestConstructWithMessageAndException() { var ex = new Exception(); var fixture = new GroupParticipantRemovalException("message", ex); Assert.AreSame(ex, fixture.InnerException); Assert.AreEqual(HttpStatusCode.InternalServerError, fixture.StatusCode); }
public void TestRemoveParticipantFromMyGroupWithGroupParticipantRemovalException() { var ex = new GroupParticipantRemovalException("message"); _groupToolService.Setup(mocked => mocked.RemoveParticipantFromMyGroup(_auth, 2, 3, "test")).Throws(ex); try { _fixture.RemoveParticipantFromMyGroup(2, 3, "test"); Assert.Fail("Expected exception was not thrown"); } catch (HttpResponseException e) { Assert.AreEqual(ex.StatusCode, e.Response.StatusCode); } _groupToolService.VerifyAll(); }
public void TestApproveDenyInquiryFromMyGroupWithGroupParticipantRemovalException() { var ex = new GroupParticipantRemovalException("message"); const int groupTypeId = 1; const int groupId = 2; const bool approve = true; var inquiry = new Inquiry(); inquiry.Message = "message"; _groupToolService.Setup(mocked => mocked.ApproveDenyInquiryFromMyGroup(_auth, groupId, approve, inquiry, inquiry.Message, It.IsAny <int>())).Throws(ex); try { _fixture.ApproveDenyInquiryFromMyGroup(groupTypeId, groupId, approve, inquiry); Assert.Fail("Expected exception was not thrown"); } catch (HttpResponseException e) { Assert.AreEqual(ex.StatusCode, e.Response.StatusCode); } _groupToolService.VerifyAll(); }