Example #1
0
        public void ShouldSetStatusToInterested()
        {
            var       fakeToken             = "letmein";
            const int groupLeaderInterested = 2;
            var       mockParticpant        = ParticipantMock();

            _configWrapper.Setup(m => m.GetConfigIntValue("GroupLeaderInterested")).Returns(groupLeaderInterested);
            _participantRepository.Setup(m => m.GetParticipantRecord(fakeToken)).Returns(mockParticpant);
            mockParticpant.GroupLeaderStatus = groupLeaderInterested;
            _participantRepository.Setup(m => m.UpdateParticipant(mockParticpant));
            _fixture.SetInterested(fakeToken);
        }
Example #2
0
 public async Task <IHttpActionResult> InterestedInGroupLeadership()
 {
     return(await Authorized(token =>
     {
         try
         {
             _groupLeaderService.SetInterested(token);
             return Ok();
         }
         catch (Exception e)
         {
             var apiError = new ApiErrorDto("Failed to start the application", e);
             throw new HttpResponseException(apiError.HttpResponseMessage);
         }
     }));
 }