diff options
Diffstat (limited to 'src/DevHive.Tests/DevHive.Data.Tests')
| -rw-r--r-- | src/DevHive.Tests/DevHive.Data.Tests/DevHive.Data.Tests.csproj | 1 | ||||
| -rw-r--r-- | src/DevHive.Tests/DevHive.Data.Tests/UserRepositoryTests.cs | 17 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/DevHive.Tests/DevHive.Data.Tests/DevHive.Data.Tests.csproj b/src/DevHive.Tests/DevHive.Data.Tests/DevHive.Data.Tests.csproj index 509ceef..81e7b2b 100644 --- a/src/DevHive.Tests/DevHive.Data.Tests/DevHive.Data.Tests.csproj +++ b/src/DevHive.Tests/DevHive.Data.Tests/DevHive.Data.Tests.csproj @@ -8,6 +8,7 @@ <ItemGroup> <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="5.0.1" /> + <PackageReference Include="Moq" Version="4.15.2" /> <PackageReference Include="NUnit" Version="3.13.0" /> <PackageReference Include="NUnit3TestAdapter" Version="3.17.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" /> diff --git a/src/DevHive.Tests/DevHive.Data.Tests/UserRepositoryTests.cs b/src/DevHive.Tests/DevHive.Data.Tests/UserRepositoryTests.cs index a88de7f..81f62db 100644 --- a/src/DevHive.Tests/DevHive.Data.Tests/UserRepositoryTests.cs +++ b/src/DevHive.Tests/DevHive.Data.Tests/UserRepositoryTests.cs @@ -1,5 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using DevHive.Data.Models; using DevHive.Data.Repositories; using Microsoft.EntityFrameworkCore; +using Moq; using NUnit.Framework; namespace DevHive.Data.Tests @@ -9,19 +14,29 @@ namespace DevHive.Data.Tests { private DevHiveContext _context; private UserRepository _userRepository; + private User _dummyUser; [SetUp] public void Setup() { + //Naming convention: MethodName_ExpectedBehavior_StateUnderTest var options = new DbContextOptionsBuilder<DevHiveContext>() .UseInMemoryDatabase("DevHive_UserRepository_Database"); this._context = new DevHiveContext(options.Options); this._userRepository = new UserRepository(_context); + + this._dummyUser = new Mock<User>().Object; + + foreach (var item in _dummyUser.Langauges) + System.Console.WriteLine(item); + + foreach (var item in _dummyUser.Technologies) + System.Console.WriteLine(item); } [Test] - public void Test() + public void AddAsync_ShouldAddUserToDatabase() { } |
