Exemple #1
0
        public async Task CredentialsTranscript_Import_Success()
        {
            // Arrange
            var response = new Mock <RestResponse <CredentialsAPIResponseModel> >();

            response.Object.StatusCode  = System.Net.HttpStatusCode.OK;
            response.Object.Data        = new CredentialsAPIResponseModel();
            response.Object.Data.STATUS = "SUCCESS";
            response.Object.Data.ERROR  = null;
            _mockRestClient.Setup(s => s.ExecuteTaskAsync <CredentialsAPIResponseModel>(It.IsAny <RestRequest>())).ReturnsAsync(response.Object);

            MemoryStream fileStream = new MemoryStream();

            // Act
            await _transcriptAPIProviderService.ImportTranscriptAsync("transcriptProviderId-1", xello_test_account_school_id, "pdf", fileStream);

            // Assert (No exception)
        }
        public async Task ImportTranscriptAsync(int schoolId, int educatorId, string fileType, Stream fileStream)
        {
            // Get School Settings
            SchoolSettingModel schoolSettings = await _schoolSettingRepository.GetBySchoolIdAsync(schoolId);

            // License check
            LicenseCheck(schoolSettings);

            // Send the transcript via API
            await _transcriptProviderAPIService.ImportTranscriptAsync(schoolSettings.TranscriptProviderId, schoolId, fileType, fileStream);
        }