public async Task Setup()
        {
            _apiTester = new ApiIntegrationTester();
            var accountStatisticsDataHelper = new AccountStatisticsDataHelper();
            var financeStatisticsDataHelper = new FinanceStatisticsDataHelper();

            _expectedStatisticsViewModel = await accountStatisticsDataHelper.GetStatistics();

            if (AnyAccountStatisticsAreZero(_expectedStatisticsViewModel))
            {
                await accountStatisticsDataHelper.CreateAccountStatistics();

                _expectedStatisticsViewModel = await accountStatisticsDataHelper.GetStatistics();
            }

            var financialStatistics = await financeStatisticsDataHelper.GetStatistics();

            if (AnyFinanceStatisticsAreZero(financialStatistics))
            {
                await financeStatisticsDataHelper.CreateFinanceStatistics();

                financialStatistics = await financeStatisticsDataHelper.GetStatistics();
            }

            _expectedStatisticsViewModel.TotalPayments = financialStatistics.TotalPayments;

            _actualResponse = await _apiTester.InvokeGetAsync <StatisticsViewModel>(new CallRequirements("api/statistics"));
        }
        public async Task ThenTheStatusShouldBeBadRequest()
        {
            // Arrange
            var callRequirements =
                new CallRequirements("api/accounts/%20/legalentities");

            // Act
            var response = await ApiIntegrationTester.InvokeIsolatedGetAsync(callRequirements);

            // Assert
            response.ExpectControllerType(typeof(LegalEntitiesController));
            response.ExpectValidationError();
        }
예제 #3
0
        public async Task ThenTheStatusShouldBeOk()
        {
            // Arrange
            var call = new CallRequirements("api/HealthCheck");

            // Act
            var response = await ApiIntegrationTester.InvokeIsolatedGetAsync(call);

            // Assert

            response.ExpectStatusCodes(HttpStatusCode.OK);
            Assert.Pass("Verified we got OK");
        }
        public async Task Setup()
        {
            _tester = new ApiIntegrationTester(TestSetupIoC.CreateIoC);

            // Arrange
            await _tester.InitialiseData <EmployerAccountsDbBuilder>(async builder =>
            {
                var data = new TestModelBuilder()
                           .WithNewUser()
                           .WithNewAccount();

                await builder.SetupDataAsync(data);

                _employerAccount = data.CurrentAccount.AccountOutput;
            });
        }
예제 #5
0
 public void SetUp()
 {
     _tester = new ApiIntegrationTester(TestSetupIoC.CreateIoC);
 }
 public void SetUp()
 {
     _tester = new ApiIntegrationTester();
 }