public async Task GetSolutionFailoverPlansPaginatedAsync_ValidParameters_ExpectedResult() { IUKFastDRaaSClient client = Substitute.For <IUKFastDRaaSClient>(); client.GetPaginatedAsync <FailoverPlan>( "/draas/v1/solutions/00000000-0000-0000-0000-000000000000/failover-plans", null).Returns(Task.Run(() => new Paginated <FailoverPlan>(client, "/draas/v1/solutions/00000000-0000-0000-0000-000000000000/failover-plans", null, new ClientResponse <IList <FailoverPlan> >() { Body = new ClientResponseBody <IList <FailoverPlan> >() { Data = new List <FailoverPlan>() { new FailoverPlan(), new FailoverPlan() } } }))); var ops = new FailoverPlanOperations <FailoverPlan>(client); var solutionID = "00000000-0000-0000-0000-000000000000"; var failoverPlans = await ops.GetSolutionFailoverPlansPaginatedAsync(solutionID); Assert.AreEqual(2, failoverPlans.Items.Count); }
public async Task GetSolutionFailoverPlansPaginatedAsync_InvalidSolutionID_ThrowsUKFastClientValidationException() { var ops = new FailoverPlanOperations <FailoverPlan>(null); await Assert.ThrowsExceptionAsync <UKFastClientValidationException>(() => ops.GetSolutionFailoverPlansPaginatedAsync("")); }