diff options
| author | transtrike <transtrike@gmail.com> | 2021-01-14 00:12:48 +0200 |
|---|---|---|
| committer | transtrike <transtrike@gmail.com> | 2021-01-14 00:12:48 +0200 |
| commit | 2948a92492141f4d807449191901f499530d8465 (patch) | |
| tree | 36d30886af22351d86d937f03558c501254ad621 /src/DevHive.Tests | |
| parent | d77add41838823ad50caf8d1ae5ee8e61c1bb26b (diff) | |
| download | DevHive-2948a92492141f4d807449191901f499530d8465.tar DevHive-2948a92492141f4d807449191901f499530d8465.tar.gz DevHive-2948a92492141f4d807449191901f499530d8465.zip | |
Fixed issues in Language & Technology and their interactions with User
Diffstat (limited to 'src/DevHive.Tests')
| -rw-r--r-- | src/DevHive.Tests/DevHive.Data.Tests/TechnologyRepository.Tests.cs | 14 | ||||
| -rw-r--r-- | src/DevHive.Tests/DevHive.Services.Tests/TechnologyServices.Tests.cs | 8 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/DevHive.Tests/DevHive.Data.Tests/TechnologyRepository.Tests.cs b/src/DevHive.Tests/DevHive.Data.Tests/TechnologyRepository.Tests.cs index 54cf7c0..6ff5fa2 100644 --- a/src/DevHive.Tests/DevHive.Data.Tests/TechnologyRepository.Tests.cs +++ b/src/DevHive.Tests/DevHive.Data.Tests/TechnologyRepository.Tests.cs @@ -106,7 +106,7 @@ namespace DevHive.Data.Tests } #endregion - #region DoesTechnologyNameExist + #region DoesTechnologyNameExistAsync [Test] public void DoesTechnologyNameExist_ReturnsTrue_IfTechnologyExists() { @@ -114,20 +114,20 @@ namespace DevHive.Data.Tests { AddEntity(); - bool result = await this.TechnologyRepository.DoesTechnologyNameExist(TECHNOLOGY_NAME); + bool result = await this.TechnologyRepository.DoesTechnologyNameExistAsync(TECHNOLOGY_NAME); Assert.IsTrue(result, "DoesTechnologyNameExists returns true when technology name does not exist"); }).GetAwaiter().GetResult(); - } + } [Test] public void DoesTechnologyNameExist_ReturnsFalse_IfTechnologyDoesNotExists() { Task.Run(async () => { - bool result = await this.TechnologyRepository.DoesTechnologyNameExist(TECHNOLOGY_NAME); + bool result = await this.TechnologyRepository.DoesTechnologyNameExistAsync(TECHNOLOGY_NAME); - Assert.False(result, "DoesTechnologyNameExist returns true when technology name does not exist"); + Assert.False(result, "DoesTechnologyNameExistAsync returns true when technology name does not exist"); }).GetAwaiter().GetResult(); } #endregion @@ -162,7 +162,7 @@ namespace DevHive.Data.Tests #region DeleteAsync [Test] public void DeleteAsync_ReturnsTrue_IfDeletionIsSuccesfull() - { + { Task.Run(async () => { AddEntity(); @@ -173,7 +173,7 @@ namespace DevHive.Data.Tests Assert.IsTrue(result, "DeleteAsync returns false when deletion is successfull"); }).GetAwaiter().GetResult(); - } + } #endregion #region HelperMethods diff --git a/src/DevHive.Tests/DevHive.Services.Tests/TechnologyServices.Tests.cs b/src/DevHive.Tests/DevHive.Services.Tests/TechnologyServices.Tests.cs index f2232a8..e56c508 100644 --- a/src/DevHive.Tests/DevHive.Services.Tests/TechnologyServices.Tests.cs +++ b/src/DevHive.Tests/DevHive.Services.Tests/TechnologyServices.Tests.cs @@ -45,7 +45,7 @@ namespace DevHive.Services.Tests Name = technologyName }; - this.TechnologyRepositoryMock.Setup(p => p.DoesTechnologyNameExist(It.IsAny<string>())).Returns(Task.FromResult(false)); + this.TechnologyRepositoryMock.Setup(p => p.DoesTechnologyNameExistAsync(It.IsAny<string>())).Returns(Task.FromResult(false)); this.TechnologyRepositoryMock.Setup(p => p.AddAsync(It.IsAny<Technology>())).Returns(Task.FromResult(shouldFail)); this.MapperMock.Setup(p => p.Map<Technology>(It.IsAny<CreateTechnologyServiceModel>())).Returns(technology); @@ -72,7 +72,7 @@ namespace DevHive.Services.Tests Name = technologyName }; - this.TechnologyRepositoryMock.Setup(p => p.DoesTechnologyNameExist(It.IsAny<string>())).Returns(Task.FromResult(true)); + this.TechnologyRepositoryMock.Setup(p => p.DoesTechnologyNameExistAsync(It.IsAny<string>())).Returns(Task.FromResult(true)); try { @@ -158,7 +158,7 @@ namespace DevHive.Services.Tests // }; // this.TechnologyRepositoryMock.Setup(p => p.DoesTechnologyExistAsync(It.IsAny<Guid>())).Returns(Task.FromResult(true)); - // this.TechnologyRepositoryMock.Setup(p => p.DoesTechnologyNameExist(It.IsAny<string>())).Returns(Task.FromResult(false)); + // this.TechnologyRepositoryMock.Setup(p => p.DoesTechnologyNameExistAsync(It.IsAny<string>())).Returns(Task.FromResult(false)); // this.TechnologyRepositoryMock.Setup(p => p.EditAsync(It.IsAny<Technology>())).Returns(Task.FromResult(shouldPass)); // this.MapperMock.Setup(p => p.Map<Technology>(It.IsAny<UpdateTechnologyServiceModel>())).Returns(technology); @@ -207,7 +207,7 @@ namespace DevHive.Services.Tests // }; // this.TechnologyRepositoryMock.Setup(p => p.DoesTechnologyExistAsync(It.IsAny<Guid>())).Returns(Task.FromResult(true)); - // this.TechnologyRepositoryMock.Setup(p => p.DoesTechnologyNameExist(It.IsAny<string>())).Returns(Task.FromResult(true)); + // this.TechnologyRepositoryMock.Setup(p => p.DoesTechnologyNameExistAsync(It.IsAny<string>())).Returns(Task.FromResult(true)); // try // { |
