Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joshika39 committed Oct 6, 2023
1 parent d7a96e3 commit bc43737
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions _src/Implementation/Repositories/AJsonRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ protected AJsonRepository(IApplicationSettings applicationSettings, string repos
_updatedEntities = new List<T>();
_addedEntities = new List<T>();
_removedEntities = new List<Guid>();
Guid.NewGuid();
_dataPath = Path.Join(applicationSettings.ConfigurationFolder, "Repositories");
_dataPath = applicationSettings.RepositoryPath!;
_filePath = Path.Join(_dataPath, $"{repositoryKey}.json");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public async Task JRT_0011_Given_EmptyRepository_When_CreateEntityCalled_Then_En
[Fact]
public async Task JRT_0021_Given_JsonFile_When_GetAllEntitiesCalled_Then_AllEntitiesReturns()
{
var fileName = @".\Resources\JRT\0021-users";
await using var repository = CreateRepositoryFactory(@".\Resources\JRT").CreateJsonRepository<User>(fileName);
var fileName = @".\Resources\JRT\0021-users.json";
await using var repository = CreateRepositoryFactory(@".\Resources\JRT").CreateJsonRepository<User>("0021-users");
var allUsers = await repository.GetAllEntities();
Assert.True(File.Exists(fileName));
Assert.Equal(4, allUsers.Count());
Expand All @@ -81,6 +81,7 @@ private IApplicationSettings CreateMockApplicationSettings(string folder)
{
var mock = new Mock<IApplicationSettings>();
mock.Setup((a) => a.ConfigurationFolder).Returns(folder);
mock.Setup((a) => a.RepositoryPath).Returns(folder);
return mock.Object;
}

Expand Down

0 comments on commit bc43737

Please sign in to comment.