public async Task ReturnNullIfTourStepsFileIsEmpty() { // Arrange _tourStepsStore = new TourStepsStore(_configuration, _httpClientUtility, _fileUtility, _tourStepsCache); // Act - Fetch ja-JP tour steps which is empty var japaneseTourStepsList = await _tourStepsStore.FetchTourStepsListAsync("ja-JP"); // Assert Assert.Null(japaneseTourStepsList); }
public async Task CorrectlySeedLocaleCachesOfTourStepsWhenMultipleRequestsReceived() { // Arrange _tourStepsStore = new TourStepsStore(_configuration, _httpClientUtility, _fileUtility, _tourStepsCache); // Act // Fetch en-US tourSteps var englisthTourStepsList = await _tourStepsStore.FetchTourStepsListAsync("en-US"); /*Asert*/ Assert.Equal(26, englisthTourStepsList.TourSteps.Count); }
public async Task ReturnNullIfTourStepsFileHasEmptyJsonObject() { var configuration = new ConfigurationBuilder() .AddJsonFile(Path.Combine(Environment.CurrentDirectory, "GithubTestFiles", "appsettings-test.json")) .Build(); var org = configuration["BlobStorage:Org"]; var branchName = configuration["BlobStorage:Branch"]; _tourStepsStore = new TourStepsStore(configuration, _httpClientUtility, _fileUtility, _tourStepsCache); // Act - Fetch ja-JP tour steps which is empty var japaneseTourStepsList = await _tourStepsStore.FetchTourStepsListAsync("ja-JP", org, branchName); // Assert Assert.NotNull(japaneseTourStepsList); }
public async Task FetchTourStepsFromGithub() { var configuration = new ConfigurationBuilder() .AddJsonFile(Path.Combine(Environment.CurrentDirectory, "GithubTestFiles", "appsettings-test.json")) .Build(); var org = configuration["BlobStorage:Org"]; var branchName = configuration["BlobStorage:Branch"]; _tourStepsStore = new TourStepsStore(configuration, _httpClientUtility, _fileUtility, _tourStepsCache); /*Act*/ // Fetch en-US tour steps var englishTourStepsList = await _tourStepsStore.FetchTourStepsListAsync("en-US", org, branchName); /*Assert*/ Assert.NotNull(englishTourStepsList); Assert.Equal(26, englishTourStepsList.TourSteps.Count); }