public async Task When_AdviserDetailsWithNoContent_Throw_Exception() { var restClient = Substitute.For <IRestClient>(); restClient.LastResponse = new RestClient.APIResponse(new HttpResponseMessage(HttpStatusCode.NoContent)); DssService = new DssService(restClient, DssSettings, Logger); DssService.Invoking(sut => sut.GetGoalDetails("customerId", "interactionId2", "actionPlanId", "goalId")) .Should().Throw <DssException>(); }
public async Task When_GetSessionWithNoContent_Return_Exception() { var restClient = Substitute.For <IRestClient>(); restClient.LastResponse = new RestClient.APIResponse(new HttpResponseMessage(HttpStatusCode.NoContent)); DssService = new DssService(restClient, DssSettings, Logger); DssService.Invoking(sut => sut.GetSessions("993cfb94-12b7-41c4-b32d-7be9331174f1", "saddasdsadsa")) .Should().Throw <DssException>(); }
public async Task When_GetSessionErrors_Return_Exception() { var restClient = Substitute.For <IRestClient>(); restClient.GetAsync <List <Session> >(Arg.Any <string>(), Arg.Any <HttpRequestMessage>()).ThrowsForAnyArgs(new Exception("error")); DssService = new DssService(restClient, DssSettings, Logger); DssService.Invoking(sut => sut.GetSessions("993cfb94-12b7-41c4-b32d-7be9331174f1", "saddasdsadsa")) .Should().Throw <DssException>(); Logger.ReceivedCalls().Count().Equals(1); }
public async Task When_GetActionsWithNoContent_Return_EmptyList() { var restClient = Substitute.For <IRestClient>(); restClient.LastResponse = new RestClient.APIResponse(new HttpResponseMessage(HttpStatusCode.NoContent)); DssService = new DssService(restClient, DssSettings, Logger); var result = await DssService.GetActions("customer", "interactionid", "actionplanid"); result.Count.Should().Be(0); }
public async Task When_AdviserDetailsErrors_Throw_Exception() { var restClient = Substitute.For <IRestClient>(); restClient.LastResponse = new RestClient.APIResponse(new HttpResponseMessage(HttpStatusCode.NoContent)); DssService = new DssService(restClient, DssSettings, Logger); restClient.GetAsync <Goal>(Arg.Any <string>(), Arg.Any <HttpRequestMessage>()).ThrowsForAnyArgs(new Exception("error")); DssService.Invoking(sut => sut.GetGoalDetails("customerId", "interactionId2", "actionPlanId", "goalId")) .Should().Throw <DssException>(); Logger.ReceivedCalls().Count().Equals(1); }
public async Task When_GetInteractionDetailsErrors_Return_EmptyList() { var restClient = Substitute.For <IRestClient>(); restClient.LastResponse = new RestClient.APIResponse(new HttpResponseMessage(HttpStatusCode.NoContent)); DssService = new DssService(restClient, DssSettings, Logger); restClient.GetAsync <Interaction>(Arg.Any <string>(), Arg.Any <HttpRequestMessage>()).ThrowsForAnyArgs(new Exception("error")); DssService.Invoking(sut => sut.GetInteractionDetails("993cfb94-12b7-41c4-b32d-7be9331174f1", "saddasdsadsa")) .Should().Throw <DssException>(); Logger.ReceivedCalls().Count().Equals(1); }
public async Task When_GetGoalsDataWithNoContent_Return_Exception() { var restClient = Substitute.For <IRestClient>(); restClient.LastResponse = new RestClient.APIResponse(new HttpResponseMessage(HttpStatusCode.NoContent)); DssService = new DssService(restClient, DssSettings, Logger); restClient.GetAsync <List <Goal> >(Arg.Any <string>(), Arg.Any <HttpRequestMessage>()).ThrowsForAnyArgs(new Exception("error")); DssService.Invoking(sut => sut.GetGoals("customer", "interactionid", "actionplanid")) .Should().Throw <DssException>(); Logger.ReceivedCalls().Count().Equals(1); }
public async Task When_GetSessionData_ReturnSession() { var result = await DssService.GetSessions("customer", "interaction"); result.Should().NotBeNull(); }
public async Task When_GetGoalDetails_ReturnGoalDetails() { var result = await DssService.GetGoalDetails("customerId", "interactionId2", "actionPlanId", "goalId"); result.Should().NotBe(null); }
public async Task When_GetAdviserDetails_ReturnAdviserDetails() { var result = await DssService.GetAdviserDetails("adverid"); result.Should().NotBe(null); }
public async Task When_GetGetInteractionDetails_ReturnInterationDetails() { var result = await DssService.GetInteractionDetails("customer", "interactionid"); result.Should().NotBe(null); }
public async Task When_GetActionsData_ReturnGetActionsList() { var result = await DssService.GetActions("customer", "interactionid", "actionplanid"); result.Count.Should().Be(3); }